Capstone project of the Udacity DevOps Engineer Nanodegree
- Working in AWS
- Using Jenkins to implement Continuous Integration and Continuous Deployment
- Building pipelines
- Working with CloudFormation to deploy clusters
- Building Kubernetes clusters
- Building Docker containers in pipelines
In this project I have applied the skills and knowledge which were developed throughout the Cloud DevOps Nanodegree program.
The application used here is a basic website with an index.html page that runs over the NGINX server. I have created a CI/CD pipeline that deploys website to a cluster in AWS EKS which is Rollout Deployment.
Cloudformation is used to deploy the Kubernetes Cluster and the NodeGroup. The code is in cloudformation_files directory. It is divided in two stacks, one for the network (network.yml) and a second one for the cluster itself (AWS_EKS.yml).
I am using a CI/CD pipeline on a rolling deployment. On each HTML change, the docker image is pushed to AWS and the Kubernetes pods are rolled out so they restart with the new image from the repository. There is a load balancer before the exposed 8000 TCP ports to avoid having downtime. These are the steps in more detail:
![Jenkins Pipeline](./jenkins pipeline)
- Create network environment to the AWS
./create.sh capstone-network network.yml network-parameters.json
- Then create AWS ELK cluster
./create.sh capstone-eks AWS_EKS.yml AWS_EKS_parameters.json
- Create Image
docker-compose build
- Tag & Push
docker tag capstone:latest rajxxx/capstone:latest
docker push rajxxx/capstone:latest
- Start Docker Container
docker container run -d rajxxx/capstone:latest
- Set current kubectl context
kubectl config use-context arn:aws:eks:us-east-1:418573230812:cluster/AWSEKSCLUSTER
- Deployment
kubectl apply -f kubernetes_files/deploy.yml kubectl apply -f kubernetes_files/LoadBalancer.yml
- Rollout Deployment
Rollout the pods to use the new pushed image.
kubectl rollout restart deployment/application
Finally, enter the public DNS record in the web browser to access the page.
$ kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
application 1/1 1 1 67m
Website Url :- http://a51b38bfe87114c2bbe51d289c244393-131057743.us-east-1.elb.amazonaws.com:8000/