Now lets deploy Helm Based Application to EKS using Spinnaker pipeline.
Click on Create Application
and enter details as Product-Detail
Click on Pipelines
under Product-Detail
and click on Configure a new pipeline
and add the name as below.
Click on Configuration
under Pipelines
and click on Add Trigger
. This is the ECR registry we had setup in Spinnaker manifest in Configure Artifact chapter. Follow the below setup and click on “Save Changes”.
Click on Add Stage
and select Bake Manifest
for Type from the dropdown
Select “Helm3” as Render Engine and enter name.
Select “Define a new artifact” for Expected Artifact and select your Git account that shows in dropdown. This is the Git account we had setup in Spinnaker manifest in Configure Artifact chapter. And then enter the below git location in the Content URL and add main
as the Commit/Branch. This is to provide the the Helm template for the deployment.
Under the Overrides
section, Select “create new artifact” for Expected Artifact and select your Git account that shows in dropdown. This is the Git account we had setup in Spinnaker manifest in Configure Artifact chapter. And then enter the below git location in the Content URL and add main
as the Commit/Branch. This is to provide the overrides for the Helm template using values.yaml.
Produces Artifact
and change the name to helm-produced-artifact
and click on Save Changes.Add Stage
and select Deploy (Manifest)
from the dropdown for Type, and give a name as Bake proddetail
.spinnaker-workshop
from the dropdown for Account. This is the EKS account we had setup in Spinnaker manifest in Add EKS Account chapter.helm-produced-artifact
from the dropdown for Manifest Artifact and click on Save Changes.To ensure that the ECR trigger will work in Spinnaker UI:
~/environment/eks-microservice-demo/apps/detail/app.js
and add a comment to first line of the file like below// commenting for file for docker image generation
Ensure that the image tag (APP_VERSION) you are adding below does not exist in the ECR repository eks-microservice-demo/test
otherwise the trigger will not work. Spinnaker pipeline only triggers when a new version of image is added to ECR.
And then run the below command in Cloud9 terminal.
cd ~/environment/eks-microservice-demo
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
export APP_VERSION=1.0
export ECR_REPOSITORY=eks-microservice-demo/test
TARGET=$ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$APP_VERSION
docker build -t $TARGET apps/detail --no-cache
docker push $TARGET
Building/Pushing Container images first time to ECR may take around 3-5 minutes
Execution Details
of pipelinefrontend
and detail
service below. kubectl get all -n detail
NAME READY STATUS RESTARTS AGE
pod/frontend-677dd7d654-nzxbq 1/1 Running 0 152m
pod/nginx-deployment-6dc677db6-jchq8 1/1 Running 0 22h
pod/proddetail-65cf5d598c-h9l7s 1/1 Running 0 152m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/frontend LoadBalancer 10.100.73.76 a991d7csdsdsdsdsdsds-1949669176.XXXXX.elb.amazonaws.com 9000:30229/TCP 152m
service/proddetail ClusterIP 10.100.37.158 <none> 3000/TCP 152m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/frontend 1/1 1 1 152m
deployment.apps/nginx-deployment 1/1 1 1 22h
deployment.apps/proddetail 1/1 1 1 152m
NAME DESIRED CURRENT READY AGE
replicaset.apps/frontend-677dd7d654 1 1 1 152m
replicaset.apps/nginx-deployment-6dc677db6 1 1 1 22h
replicaset.apps/proddetail-65cf5d598c 1 1 1 152m