Now, we are ready to push our application. Here we are calling the
aws-eks/python3 executor which will define the environment in which the steps of our job will be run.
deploy_app:executor: aws-eks/python3parameters:cluster-name:type: stringdocker-image-name:type: stringversion-info:type: stringaws-region:type: stringdefault: ""steps:- checkout- run:name: Create deployment manifestcommand: |BUILD_DATE=$(date '+%Y%m%d%H%M%S')cat deployment/goof-deployment-template.yaml |\sed "s|DOCKER_IMAGE_NAME|<< parameters.docker-image-name >>|g"\> deployment/goof-deployment.yaml- aws-eks/update-kubeconfig-with-authenticator:cluster-name: << parameters.cluster-name >>install-kubectl: trueaws-region: << parameters.aws-region >>- kubernetes/create-or-update-resource:resource-file-path: "deployment/goof-deployment.yaml"get-rollout-status: trueresource-name: deployment/goof- kubernetes/create-or-update-resource:resource-file-path: "deployment/goof-service.yaml"
In this job, we are passing a few parameters such as the Kubernetes
cluster-name and the
docker-image-name which references the image we recently created. We are using these values to authenticate to our Kubernetes cluster and also to replace the value of our image in our Kubernetes manifest with the Amazon ECR repository URL and tag. Then, will invoke the
kubernetes/create-or-update-resources command to apply our Kubernetes manifests for the deployment and service.