- Install GIT
- EKS Cluster
- Install ALB-Ingress-Controller
- Request a Cerficate using Certificate Manager
- Create Hosted Zone with our Domain Name
- External DNS Setup
In AWS certificate Manager:
Note : ARN for certificate : arn:aws:acm:us-east-1:136962450893:certificate/c4e6bf26-02df-4e49-b88b-9412562c1966
yum install git -y
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_13.x | sudo -E bash -
sudo yum install -y nodejs
yum install docker -y
service docker start
git clone https://github.com/Naresh240/RollingUpdate-Rollback-NodejsApp
cd RollingUpdate-Rollback-NodejsApp
npm install
docker build -t naresh240/nodejs-k8s:v1 .
docker login
docker push naresh240/nodejs-k8s:v1
kubectl apply -f deployment.yml
kubectl apply -f service.yml
kubectl get pods
kubectl get svc
kubectl apply -f ingress.yml
without externaldns and security:
kubectl get ingress
#remove paths for ssl and execute it again (kubectl apply -f ingress.yml and kubectl get ingress)
Now another load balance is created
http://nodejs.staticwebsitehosting.tk/
Edit our our application and Build docker image with new tag:
docker build -t naresh240/nodejs-k8s:v2 .
Push Docker image to docker hub with tag v2:
docker push naresh240/nodejs-k8s:v2
upgrade nodejs application with tag v2:
kubectl rollout history deployment nodejs-deployment
Check rollout history for revision "1"
kubectl rollout history deployment nodejs-deployment --revision=1
Upgrade new image using below command
kubectl set image deployment nodejs-deployment nodejs-deployment=naresh240/nodejs-k8s:v2
Check rollout history for revision "2"
kubectl rollout history deployment nodejs-deployment --revision=2
Rollout to previous version using below command
kubectl rollout undo deployment nodejs-deployment --to-revision=1