This project is part of my Udacity Nanodegree requirements.
-CI/CD with Rolling Update This project uses Jenkins as CI/CD tool for deployement of Docker container using Rolling Deployemnt. In Rolling Deployement startegy Kubernates creates additional pods with new Docker Image and wait to pass the health check for new application. After passing the health check only, It routes traffic to new application and destroy older pods. It help us to achieve zero downtime with more reliability.
-Autoscaling with EKS This project uses private Elastic Container Registry (ECR) to store Docker images and AWS EKS Cluster to host application.
-Infrastructure as Code It uses Cloudformation for automating EKS Infra creation.
infra
: Build related scripts and files.infra > cloudformation
: Cloudformation template for EKS Infrainfra > k8
: Kubernates connfig for app and deploymentsinfra > scripts
: Bash script for running cloudformation and Docker buildnest-app
: A Sample Nest.js application, using Jest as testing framework.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
- Go to
scripts
dircd infra/scripts
andchmod +x *
to add execute permission - Create EKS Infrastructure via CloudFormation
- Create Network Infrastructure First
./create-stack.sh <stack_name> ../cloudformation/network.cf.yml ../cloudformation/network.param.json
: creates the network stack./create-stack.sh <stack_name> ../cloudformation/eks.cf.yml ../cloudformation/eks.param.json
: creates the EKS stack./delete-stack.sh <stack_name>
: Deletes the <stack_name>
# Get Details of k8 cluster
kubectl get all
# Get Deployemnts
kubectl get deployments
# Get Nodes
kubectl get nodes
# Get Pods
kubectl get pods
# See PODs logs , Identifier can be label, Id etc
kubectl logs <pod_idenntifier>