From 27588ffa3dab68488c5ef92d2b6f9b1c2c8a64b2 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 16:48:57 +0500 Subject: [PATCH 01/38] Added build --- buildspec_eks.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ deployment.yaml | 25 +++++++++++++++++++++++++ service.yaml | 18 ++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 buildspec_eks.yml create mode 100644 deployment.yaml create mode 100644 service.yaml diff --git a/buildspec_eks.yml b/buildspec_eks.yml new file mode 100644 index 0000000..bf00d7b --- /dev/null +++ b/buildspec_eks.yml @@ -0,0 +1,47 @@ +version: 0.2 +run-as: root + +phases: + + install: + commands: + - echo Installing app dependencies... + - curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/kubectl + - chmod +x ./kubectl + - mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin + - echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc + - source ~/.bashrc + - echo 'Check kubectl version' + - kubectl version --short --client + - chmod +x eks_cicd/prereqs.sh + - sh eks_cicd/prereqs.sh + + pre_build: + commands: + - echo Logging in to Amazon EKS... + - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name $AWS_CLUSTER_NAME + - echo check config + - kubectl config view --minify + - echo check kubectl access + - kubectl get svc + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com + - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME + - docker pull $REPOSITORY_URI:$IMAGE_TAG + + + build: + commands: + - echo Build started on `date` + - echo Building the Docker image... + - docker build --cache-from $REPOSITORY_URI:$IMAGE_TAG -t $IMAGE_REPO_NAME:$IMAGE_TAG . + - docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + + post_build: + commands: + - echo Build completed on `date` + - echo Pushing the Docker image... + - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + - echo Push the latest image to cluster + - kubectl apply -f eks_cicd/deployment.yaml + - kubectl rollout restart -f eks_cicd/deployment.yaml diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..b5863fe --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: cicd-demo + app.kubernetes.io/instance: cicd-demo-instance + app.kubernetes.io/version: '1.0.0' + app.kubernetes.io/managed-by: kubectl + name: cicd-demo-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: cicd-demo + template: + metadata: + labels: + app: cicd-demo + spec: + containers: + - image: 120717539064.dkr.ecr.us-west-2.amazonaws.com/cicd-demo:latest + imagePullPolicy: Always + name: cicd-demo + ports: + - containerPort: 3000 diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..35475f3 --- /dev/null +++ b/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: cicd-demo + app.kubernetes.io/instance: cicd-demo-instance + app.kubernetes.io/version: "1.0.0" + app.kubernetes.io/component: backend + app.kubernetes.io/managed-by: kubectl + name: cicd-demo +spec: + selector: + app: cicd-demo + type: LoadBalancer + ports: + - protocol: TCP + port: 80 + targetPort: 3000 From ed726a0a25abfce90eee1299c9ad9de176b19f3f Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:10:22 +0500 Subject: [PATCH 02/38] Fixes --- buildspec.yml | 54 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 36775bd..8b817a4 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -1,29 +1,47 @@ version: 0.2 +run-as: root phases: + + install: + commands: + - echo Installing app dependencies... + - curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/kubectl + - chmod +x ./kubectl + - mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin + - echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc + - source ~/.bashrc + - echo 'Check kubectl version' + - kubectl version --short --client + - chmod +x eks_cicd/prereqs.sh + - sh eks_cicd/prereqs.sh + pre_build: commands: - - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/webaverse - - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) - - IMAGE_TAG=${COMMIT_HASH:=latest} + - echo Logging in to Amazon EKS... + - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name $AWS_CLUSTER_NAME + - echo check config + - kubectl config view --minify + - echo check kubectl access + - kubectl get svc + - echo Logging in to Amazon ECR... + - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com + - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app + - docker pull $REPOSITORY_URI:$IMAGE_TAG + + build: commands: - echo Build started on `date` - - echo Building the Docker image... - - echo Logging in to Docker Hub... - - echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin - - docker build -t $REPOSITORY_URI:latest . - - docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG + - echo Building the Docker image... + - docker build --cache-from $REPOSITORY_URI:$IMAGE_TAG -t ecrrepository-app:$IMAGE_TAG . + - docker tag ecrrepository-app:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG + post_build: commands: - echo Build completed on `date` - - echo Pushing the Docker images... - - echo Logging in to Amazon ECR... - - aws --version - - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com - - docker push $REPOSITORY_URI:latest - - docker push $REPOSITORY_URI:$IMAGE_TAG - - echo Writing image definitions file... - - printf '[{"name":"webaverse-preview-backend","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json -artifacts: - files: imagedefinitions.json + - echo Pushing the Docker image... + - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG + - echo Push the latest image to cluster + - kubectl apply -f eks_cicd/deployment.yaml + - kubectl rollout restart -f eks_cicd/deployment.yaml From bcbc85b78f9209ff5689f6cbc83d955c94ab9426 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:12:34 +0500 Subject: [PATCH 03/38] Fixes --- buildspec.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 8b817a4..dd927f7 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -13,8 +13,6 @@ phases: - source ~/.bashrc - echo 'Check kubectl version' - kubectl version --short --client - - chmod +x eks_cicd/prereqs.sh - - sh eks_cicd/prereqs.sh pre_build: commands: From 5b274317813e2c4406c9231bbb58e66ca0241797 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:15:20 +0500 Subject: [PATCH 04/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index dd927f7..4b74ab1 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -17,7 +17,7 @@ phases: pre_build: commands: - echo Logging in to Amazon EKS... - - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name $AWS_CLUSTER_NAME + - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server - echo check config - kubectl config view --minify - echo check kubectl access From b6a268cb2773dc64f91951a1909b2e1ae335749a Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:35:05 +0500 Subject: [PATCH 05/38] Fixes --- buildspec.yml | 19 +++++++++++-------- cluster-steup.sh | 3 +++ 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 cluster-steup.sh diff --git a/buildspec.yml b/buildspec.yml index 4b74ab1..caefa79 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -5,18 +5,21 @@ phases: install: commands: - - echo Installing app dependencies... - - curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/kubectl - - chmod +x ./kubectl - - mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin - - echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc - - source ~/.bashrc - - echo 'Check kubectl version' - - kubectl version --short --client + - echo Setting up required prerequisites + - pip install --upgrade awscli + - curl --silent --location -o /usr/local/bin/kubectl "https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/kubectl" + - chmod +x /usr/local/bin/kubectl + - curl --silent --location -o /usr/local/bin/aws-iam-authenticator "https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator" + - chmod +x /usr/local/bin/aws-iam-authenticator + - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp + - mv -v /tmp/eksctl /usr/local/bin + - chmod +x /usr/local/bin/eksctl pre_build: commands: - echo Logging in to Amazon EKS... + - chmod a+x ./cluster-setup.sh + - sh ./cluster-setup.sh - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server - echo check config - kubectl config view --minify diff --git a/cluster-steup.sh b/cluster-steup.sh new file mode 100644 index 0000000..624bbcb --- /dev/null +++ b/cluster-steup.sh @@ -0,0 +1,3 @@ +echo "Inside cluster setup" +ll +eksctl \ No newline at end of file From bd33bae522bc52424264411d55961a888f36f093 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:39:34 +0500 Subject: [PATCH 06/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index caefa79..7f80ad4 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -11,7 +11,7 @@ phases: - chmod +x /usr/local/bin/kubectl - curl --silent --location -o /usr/local/bin/aws-iam-authenticator "https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator" - chmod +x /usr/local/bin/aws-iam-authenticator - - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp + - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/v0.72.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp - mv -v /tmp/eksctl /usr/local/bin - chmod +x /usr/local/bin/eksctl From ee80f03a0948015613d4ea805cd6cb6d9d9af210 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:41:40 +0500 Subject: [PATCH 07/38] Fixes --- buildspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yml b/buildspec.yml index 7f80ad4..61b593b 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -18,6 +18,7 @@ phases: pre_build: commands: - echo Logging in to Amazon EKS... + - ll - chmod a+x ./cluster-setup.sh - sh ./cluster-setup.sh - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server From 3ddef922f8a8556070e1df5ea5d6e77912e28506 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:43:22 +0500 Subject: [PATCH 08/38] Fixes --- buildspec.yml | 2 +- cluster-steup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 61b593b..f86061f 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -18,7 +18,7 @@ phases: pre_build: commands: - echo Logging in to Amazon EKS... - - ll + - ls -l - chmod a+x ./cluster-setup.sh - sh ./cluster-setup.sh - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server diff --git a/cluster-steup.sh b/cluster-steup.sh index 624bbcb..f5beff1 100644 --- a/cluster-steup.sh +++ b/cluster-steup.sh @@ -1,3 +1,3 @@ echo "Inside cluster setup" -ll +ls -l eksctl \ No newline at end of file From 22431b2ecccc691664d7caad9f3b3536a5eaa5bd Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:45:57 +0500 Subject: [PATCH 09/38] Fixes --- cluster-steup.sh => cluster-setup.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cluster-steup.sh => cluster-setup.sh (100%) diff --git a/cluster-steup.sh b/cluster-setup.sh similarity index 100% rename from cluster-steup.sh rename to cluster-setup.sh From 23392618751e8fe604c19ec05e9822563464afef Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:53:03 +0500 Subject: [PATCH 10/38] Fixes --- cluster-setup.sh | 3 ++- cluster.yaml | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cluster.yaml diff --git a/cluster-setup.sh b/cluster-setup.sh index f5beff1..fa69396 100644 --- a/cluster-setup.sh +++ b/cluster-setup.sh @@ -1,3 +1,4 @@ echo "Inside cluster setup" ls -l -eksctl \ No newline at end of file +#Create cluster if don't exist +aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server || eksctl create cluster -f cluster.yaml \ No newline at end of file diff --git a/cluster.yaml b/cluster.yaml new file mode 100644 index 0000000..aa604df --- /dev/null +++ b/cluster.yaml @@ -0,0 +1,29 @@ +apiVersion: eksctl.io/v1alpha5 +kind: ClusterConfig + +metadata: + name: preview-server + region: us-west-2 + +vpc: + subnets: + private: + us-west-2a: { id: subnet-0ad66057 } + us-west-2b: { id: subnet-9a3e10b1 } + us-west-2c: { id: subnet-d050f4a8 } + us-west-2d: { id: subnet-d2d91898 } + +nodeGroups: + - name: ng-1-workers + labels: { role: workers } + instanceType: m5.xlarge + desiredCapacity: 10 + privateNetworking: true + - name: ng-2-builders + labels: { role: builders } + instanceType: m5.2xlarge + desiredCapacity: 2 + privateNetworking: true + iam: + withAddonPolicies: + imageBuilder: true \ No newline at end of file From 96add9cb97af2e144a005c934b1e385e0b8e7e71 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 17:57:51 +0500 Subject: [PATCH 11/38] Fixes --- cluster.yaml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cluster.yaml b/cluster.yaml index aa604df..c2d97e8 100644 --- a/cluster.yaml +++ b/cluster.yaml @@ -5,23 +5,15 @@ metadata: name: preview-server region: us-west-2 -vpc: - subnets: - private: - us-west-2a: { id: subnet-0ad66057 } - us-west-2b: { id: subnet-9a3e10b1 } - us-west-2c: { id: subnet-d050f4a8 } - us-west-2d: { id: subnet-d2d91898 } - nodeGroups: - name: ng-1-workers labels: { role: workers } - instanceType: m5.xlarge + instanceType: t2.large desiredCapacity: 10 privateNetworking: true - name: ng-2-builders labels: { role: builders } - instanceType: m5.2xlarge + instanceType: t2.large desiredCapacity: 2 privateNetworking: true iam: From 4ba68bdf6a5d92a5cd86b853e2ffb072c6b24e0b Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 19:46:08 +0500 Subject: [PATCH 12/38] Fixes --- buildspec.yml | 5 +++-- cluster.yaml | 10 +--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index f86061f..3e3926d 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -14,6 +14,7 @@ phases: - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/v0.72.0/eksctl_Linux_amd64.tar.gz" | tar xz -C /tmp - mv -v /tmp/eksctl /usr/local/bin - chmod +x /usr/local/bin/eksctl + - AWS_ACCOUNT_ID=684910554524 pre_build: commands: @@ -45,5 +46,5 @@ phases: - echo Pushing the Docker image... - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG - echo Push the latest image to cluster - - kubectl apply -f eks_cicd/deployment.yaml - - kubectl rollout restart -f eks_cicd/deployment.yaml + - kubectl apply -f deployment.yaml + - kubectl rollout restart -f deployment.yaml diff --git a/cluster.yaml b/cluster.yaml index c2d97e8..e207d88 100644 --- a/cluster.yaml +++ b/cluster.yaml @@ -9,13 +9,5 @@ nodeGroups: - name: ng-1-workers labels: { role: workers } instanceType: t2.large - desiredCapacity: 10 - privateNetworking: true - - name: ng-2-builders - labels: { role: builders } - instanceType: t2.large desiredCapacity: 2 - privateNetworking: true - iam: - withAddonPolicies: - imageBuilder: true \ No newline at end of file + privateNetworking: true \ No newline at end of file From f64432715152e47f4a40c854529aec8ea4f8b128 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:04:56 +0500 Subject: [PATCH 13/38] Fixes --- buildspec.yml | 4 +-- deployment.yaml | 25 -------------- cluster-setup.sh => eks/cluster-setup.sh | 0 cluster.yaml => eks/cluster.yaml | 0 eks/deployment.yaml | 42 ++++++++++++++++++++++++ service.yaml => eks/service.yaml | 10 +++--- 6 files changed, 49 insertions(+), 32 deletions(-) delete mode 100644 deployment.yaml rename cluster-setup.sh => eks/cluster-setup.sh (100%) rename cluster.yaml => eks/cluster.yaml (100%) create mode 100644 eks/deployment.yaml rename service.yaml => eks/service.yaml (60%) diff --git a/buildspec.yml b/buildspec.yml index 3e3926d..7dae9fc 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -21,14 +21,14 @@ phases: - echo Logging in to Amazon EKS... - ls -l - chmod a+x ./cluster-setup.sh - - sh ./cluster-setup.sh + - sh ./eks/cluster-setup.sh - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server - echo check config - kubectl config view --minify - echo check kubectl access - kubectl get svc - echo Logging in to Amazon ECR... - - aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com + - $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app - docker pull $REPOSITORY_URI:$IMAGE_TAG diff --git a/deployment.yaml b/deployment.yaml deleted file mode 100644 index b5863fe..0000000 --- a/deployment.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/name: cicd-demo - app.kubernetes.io/instance: cicd-demo-instance - app.kubernetes.io/version: '1.0.0' - app.kubernetes.io/managed-by: kubectl - name: cicd-demo-deployment -spec: - replicas: 1 - selector: - matchLabels: - app: cicd-demo - template: - metadata: - labels: - app: cicd-demo - spec: - containers: - - image: 120717539064.dkr.ecr.us-west-2.amazonaws.com/cicd-demo:latest - imagePullPolicy: Always - name: cicd-demo - ports: - - containerPort: 3000 diff --git a/cluster-setup.sh b/eks/cluster-setup.sh similarity index 100% rename from cluster-setup.sh rename to eks/cluster-setup.sh diff --git a/cluster.yaml b/eks/cluster.yaml similarity index 100% rename from cluster.yaml rename to eks/cluster.yaml diff --git a/eks/deployment.yaml b/eks/deployment.yaml new file mode 100644 index 0000000..033bc89 --- /dev/null +++ b/eks/deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: preview-server-app-development +spec: + replicas: 1 + selector: + matchLabels: + app: preview-server-app + environment: testing + template: + metadata: + labels: + app: preview-server-app + environment: testing + spec: + containers: + - name: preview-server + image: 684910554524.dkr.ecr.eu-west-2.amazonaws.com/preview-server:latest + resources: + requests: + cpu: "100m" + memory: "500Mi" + limits: + cpu: "200m" + memory: "1024Mi" + ports: + - containerPort: 8080 + name: http + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 5 + livenessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 70 + timeoutSeconds: 10 + failureThreshold: 10 diff --git a/service.yaml b/eks/service.yaml similarity index 60% rename from service.yaml rename to eks/service.yaml index 35475f3..a2379e8 100644 --- a/service.yaml +++ b/eks/service.yaml @@ -2,17 +2,17 @@ apiVersion: v1 kind: Service metadata: labels: - app.kubernetes.io/name: cicd-demo - app.kubernetes.io/instance: cicd-demo-instance + app.kubernetes.io/name: preview-server + app.kubernetes.io/instance: preview-server-instance app.kubernetes.io/version: "1.0.0" app.kubernetes.io/component: backend app.kubernetes.io/managed-by: kubectl - name: cicd-demo + name: preview-server spec: selector: - app: cicd-demo + app: preview-server type: LoadBalancer ports: - protocol: TCP port: 80 - targetPort: 3000 + targetPort: 443 From 693cf86d6ba45ad54e87cefdab3d6fa9ba4d8094 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:11:16 +0500 Subject: [PATCH 14/38] Fixes --- buildspec.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 7dae9fc..f382392 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -15,6 +15,7 @@ phases: - mv -v /tmp/eksctl /usr/local/bin - chmod +x /usr/local/bin/eksctl - AWS_ACCOUNT_ID=684910554524 + - IMAGE_TAG=latest pre_build: commands: @@ -30,9 +31,7 @@ phases: - echo Logging in to Amazon ECR... - $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) - REPOSITORY_URI=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app - - docker pull $REPOSITORY_URI:$IMAGE_TAG - build: commands: - echo Build started on `date` From f03370b6e72277395bbbaffe14d46705c1b559fa Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:14:17 +0500 Subject: [PATCH 15/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index f382392..155b7b5 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -21,7 +21,7 @@ phases: commands: - echo Logging in to Amazon EKS... - ls -l - - chmod a+x ./cluster-setup.sh + - chmod a+x ./eks/cluster-setup.sh - sh ./eks/cluster-setup.sh - aws eks --region $AWS_DEFAULT_REGION update-kubeconfig --name preview-server - echo check config From a29588c61fb038680d6b2d7815af131dcdb4a64a Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:20:32 +0500 Subject: [PATCH 16/38] Fixes --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 155b7b5..23b9661 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -45,5 +45,5 @@ phases: - echo Pushing the Docker image... - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG - echo Push the latest image to cluster - - kubectl apply -f deployment.yaml - - kubectl rollout restart -f deployment.yaml + - kubectl apply -f ./eks/deployment.yaml + - kubectl rollout restart -f ./eks/deployment.yaml From df9b6cb24e27241734dc94396117484d383732c8 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:24:38 +0500 Subject: [PATCH 17/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 23b9661..e1cbffc 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -46,4 +46,4 @@ phases: - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG - echo Push the latest image to cluster - kubectl apply -f ./eks/deployment.yaml - - kubectl rollout restart -f ./eks/deployment.yaml + - kubectl rollout restart ./eks/deployment.yaml From f063d7a3819902a6d0e67e21a0ab7745b5e96f76 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:29:26 +0500 Subject: [PATCH 18/38] Fixes --- buildspec.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index e1cbffc..e112070 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -36,14 +36,14 @@ phases: commands: - echo Build started on `date` - echo Building the Docker image... - - docker build --cache-from $REPOSITORY_URI:$IMAGE_TAG -t ecrrepository-app:$IMAGE_TAG . - - docker tag ecrrepository-app:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG + # - docker build --cache-from $REPOSITORY_URI:$IMAGE_TAG -t ecrrepository-app:$IMAGE_TAG . + # - docker tag ecrrepository-app:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG post_build: commands: - echo Build completed on `date` - echo Pushing the Docker image... - - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG + # - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG - echo Push the latest image to cluster - kubectl apply -f ./eks/deployment.yaml - kubectl rollout restart ./eks/deployment.yaml From 61acccba6d32590f04c562a03ae217f61b14bf27 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:31:29 +0500 Subject: [PATCH 19/38] Fixes --- buildspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yml b/buildspec.yml index e112070..29e83f3 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -46,4 +46,5 @@ phases: # - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/ecrrepository-app:$IMAGE_TAG - echo Push the latest image to cluster - kubectl apply -f ./eks/deployment.yaml + - kubectl rollout -h - kubectl rollout restart ./eks/deployment.yaml From 94772f9dac0c14ce81eb0a334016139edc7d3215 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 21:39:39 +0500 Subject: [PATCH 20/38] Fixes --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 29e83f3..86a8336 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -7,7 +7,7 @@ phases: commands: - echo Setting up required prerequisites - pip install --upgrade awscli - - curl --silent --location -o /usr/local/bin/kubectl "https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/kubectl" + - curl --silent --location -o /usr/local/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" - chmod +x /usr/local/bin/kubectl - curl --silent --location -o /usr/local/bin/aws-iam-authenticator "https://amazon-eks.s3-us-west-2.amazonaws.com/1.14.6/2019-08-22/bin/linux/amd64/aws-iam-authenticator" - chmod +x /usr/local/bin/aws-iam-authenticator @@ -47,4 +47,4 @@ phases: - echo Push the latest image to cluster - kubectl apply -f ./eks/deployment.yaml - kubectl rollout -h - - kubectl rollout restart ./eks/deployment.yaml + - kubectl rollout restart -f ./eks/deployment.yaml From 1fb4ea450377bd767ddacc77151a394cb24fb8b6 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 22:46:25 +0500 Subject: [PATCH 21/38] Fixes --- buildspec.yml | 1 + eks/service.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 86a8336..4689a73 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -48,3 +48,4 @@ phases: - kubectl apply -f ./eks/deployment.yaml - kubectl rollout -h - kubectl rollout restart -f ./eks/deployment.yaml + - kubectl apply -f ./eks/service.yaml diff --git a/eks/service.yaml b/eks/service.yaml index a2379e8..9ccd453 100644 --- a/eks/service.yaml +++ b/eks/service.yaml @@ -15,4 +15,4 @@ spec: ports: - protocol: TCP port: 80 - targetPort: 443 + targetPort: 80 From 95454b2c4262df3d528a0e122e7eb90298dc0351 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 22:50:30 +0500 Subject: [PATCH 22/38] Fixes --- buildspec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildspec.yml b/buildspec.yml index 4689a73..7fd5648 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -49,3 +49,5 @@ phases: - kubectl rollout -h - kubectl rollout restart -f ./eks/deployment.yaml - kubectl apply -f ./eks/service.yaml + - kubectl -n preview-server get svc preview-server + From 8ac26a4577a5069b525d7fcd10cae6ee3b460fc3 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 22:53:07 +0500 Subject: [PATCH 23/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 7fd5648..3c89220 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -49,5 +49,5 @@ phases: - kubectl rollout -h - kubectl rollout restart -f ./eks/deployment.yaml - kubectl apply -f ./eks/service.yaml - - kubectl -n preview-server get svc preview-server + - kubectl get svc preview-server From 1952e3ce3eada9098e9376235bcd1bf27115b524 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 23:37:10 +0500 Subject: [PATCH 24/38] Fixes --- eks/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eks/deployment.yaml b/eks/deployment.yaml index 033bc89..08f24f7 100644 --- a/eks/deployment.yaml +++ b/eks/deployment.yaml @@ -25,18 +25,18 @@ spec: cpu: "200m" memory: "1024Mi" ports: - - containerPort: 8080 + - containerPort: 80 name: http readinessProbe: httpGet: path: / - port: 8080 + port: 80 initialDelaySeconds: 60 timeoutSeconds: 5 livenessProbe: httpGet: path: / - port: 8080 + port: 80 initialDelaySeconds: 70 timeoutSeconds: 10 failureThreshold: 10 From 0531b1a5208630546fdae53a19a47a762240d30d Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 23:46:28 +0500 Subject: [PATCH 25/38] Fixes --- buildspec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildspec.yml b/buildspec.yml index 3c89220..5ceb512 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -50,4 +50,6 @@ phases: - kubectl rollout restart -f ./eks/deployment.yaml - kubectl apply -f ./eks/service.yaml - kubectl get svc preview-server + - export loadbalancer=$(kubectl -n my-nginx get svc my-nginx -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') + - curl -k -s http://${loadbalancer} From 4d1c5d363e97c842060eb9e51a1f65a19e1fea54 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Wed, 10 Nov 2021 23:50:17 +0500 Subject: [PATCH 26/38] Fixes --- buildspec.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 5ceb512..336a03e 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -50,6 +50,7 @@ phases: - kubectl rollout restart -f ./eks/deployment.yaml - kubectl apply -f ./eks/service.yaml - kubectl get svc preview-server - - export loadbalancer=$(kubectl -n my-nginx get svc my-nginx -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') + - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') + - echo http://${loadbalancer} - curl -k -s http://${loadbalancer} From 472c563aaca05d2736a6c446eb09c02c654d5302 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:15:39 +0500 Subject: [PATCH 27/38] Fixes --- buildspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yml b/buildspec.yml index 336a03e..f65a331 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -52,5 +52,6 @@ phases: - kubectl get svc preview-server - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - echo http://${loadbalancer} + - kubectl get pods -o wide - curl -k -s http://${loadbalancer} From a06b7fc32cc2d57478250cc0391806f72813bc27 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:20:44 +0500 Subject: [PATCH 28/38] Fixes --- buildspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yml b/buildspec.yml index f65a331..fdbafaf 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -53,5 +53,6 @@ phases: - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - echo http://${loadbalancer} - kubectl get pods -o wide + - kubectl logs -l app=preview-server - curl -k -s http://${loadbalancer} From 3d6239c9746e3a2a920896061bcca0a9fabfa799 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:23:40 +0500 Subject: [PATCH 29/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index fdbafaf..931e0ff 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -53,6 +53,6 @@ phases: - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - echo http://${loadbalancer} - kubectl get pods -o wide - - kubectl logs -l app=preview-server + - kubectl logs -l - curl -k -s http://${loadbalancer} From fd53a9dbd177506b9668fd127189805948ae940a Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:28:49 +0500 Subject: [PATCH 30/38] Fixes --- buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildspec.yml b/buildspec.yml index 931e0ff..5422293 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -53,6 +53,6 @@ phases: - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - echo http://${loadbalancer} - kubectl get pods -o wide - - kubectl logs -l + - kubectl logs -l app=preview-server-app - curl -k -s http://${loadbalancer} From 296606e6106a1d1f6fe31e2b43f0fd5dd26b8df2 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:32:11 +0500 Subject: [PATCH 31/38] Fixes --- buildspec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/buildspec.yml b/buildspec.yml index 5422293..105d75f 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -53,6 +53,7 @@ phases: - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - echo http://${loadbalancer} - kubectl get pods -o wide + - sleep 30 - kubectl logs -l app=preview-server-app - curl -k -s http://${loadbalancer} From d94418c1aef589475f9ed3388e248b21e43a9a92 Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:36:31 +0500 Subject: [PATCH 32/38] Fixes --- eks/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks/deployment.yaml b/eks/deployment.yaml index 08f24f7..997db97 100644 --- a/eks/deployment.yaml +++ b/eks/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: preview-server - image: 684910554524.dkr.ecr.eu-west-2.amazonaws.com/preview-server:latest + image: 684910554524.dkr.ecr.us-west-2.amazonaws.com/preview-server:latest resources: requests: cpu: "100m" From 308fb8e72fa3ad94bc22c9e0eb3f4c82a6eb926a Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:40:56 +0500 Subject: [PATCH 33/38] Fixes --- eks/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks/deployment.yaml b/eks/deployment.yaml index 997db97..74a6e11 100644 --- a/eks/deployment.yaml +++ b/eks/deployment.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: preview-server - image: 684910554524.dkr.ecr.us-west-2.amazonaws.com/preview-server:latest + image: 684910554524.dkr.ecr.us-west-2.amazonaws.com/ecrrepository-app:latest resources: requests: cpu: "100m" From 9519df967dcb07697b3fa2f0180525286c3fe17f Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:44:54 +0500 Subject: [PATCH 34/38] Fixes --- buildspec.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildspec.yml b/buildspec.yml index 105d75f..f1232a7 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -54,6 +54,11 @@ phases: - echo http://${loadbalancer} - kubectl get pods -o wide - sleep 30 + - kubectl get pods -o wide + - sleep 30 + - kubectl get pods -o wide + - sleep 30 + - kubectl get pods -o wide - kubectl logs -l app=preview-server-app - curl -k -s http://${loadbalancer} From 386eeda4afc81f5f9d06a95c611f20667c160b7b Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:51:38 +0500 Subject: [PATCH 35/38] Fixes --- buildspec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index f1232a7..7a1cd17 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -51,7 +51,6 @@ phases: - kubectl apply -f ./eks/service.yaml - kubectl get svc preview-server - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - - echo http://${loadbalancer} - kubectl get pods -o wide - sleep 30 - kubectl get pods -o wide @@ -60,5 +59,6 @@ phases: - sleep 30 - kubectl get pods -o wide - kubectl logs -l app=preview-server-app - - curl -k -s http://${loadbalancer} + - echo http://${loadbalancer} + - curl -k http://${loadbalancer} From b70a2a3c128fc2ef1d776294e5398ac862dbfb3f Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 00:54:12 +0500 Subject: [PATCH 36/38] Fixes --- buildspec.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/buildspec.yml b/buildspec.yml index 7a1cd17..3ad3533 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -52,11 +52,7 @@ phases: - kubectl get svc preview-server - export loadbalancer=$(kubectl get svc preview-server -o jsonpath='{.status.loadBalancer.ingress[*].hostname}') - kubectl get pods -o wide - - sleep 30 - - kubectl get pods -o wide - - sleep 30 - - kubectl get pods -o wide - - sleep 30 + - while [[ $(kubectl get pods -l app=preview-server-app -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" && sleep 1; done - kubectl get pods -o wide - kubectl logs -l app=preview-server-app - echo http://${loadbalancer} From ea8b7fde1eb08362194c481948a837790c987a1e Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 01:16:58 +0500 Subject: [PATCH 37/38] Fixes --- buildspec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildspec.yml b/buildspec.yml index 3ad3533..b15b60d 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -54,6 +54,8 @@ phases: - kubectl get pods -o wide - while [[ $(kubectl get pods -l app=preview-server-app -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" && sleep 1; done - kubectl get pods -o wide + - kubectl get endpoints + - kubectl get deployments - kubectl logs -l app=preview-server-app - echo http://${loadbalancer} - curl -k http://${loadbalancer} From 63f01b224dcae832b563d329a89fe335d32048fd Mon Sep 17 00:00:00 2001 From: Muhammad Abeer Date: Thu, 11 Nov 2021 01:21:21 +0500 Subject: [PATCH 38/38] Fixes --- eks/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks/service.yaml b/eks/service.yaml index 9ccd453..6aaac25 100644 --- a/eks/service.yaml +++ b/eks/service.yaml @@ -10,7 +10,7 @@ metadata: name: preview-server spec: selector: - app: preview-server + app: preview-server-app type: LoadBalancer ports: - protocol: TCP