Rolling Updates in Kubernetes Kodekloud

 

Question: We have an application running on Kubernetes cluster using nginx web server. The Nautilus application development team has pushed some of the latest changes and those changes need be deployed. The Nautilus DevOps team has created an image nginx:1.17 with the latest changes.

Perform a rolling update for this application and incorporate nginx:1.17 image. The deployment name is nginx-deployment

Make sure all pods are up and running after the update.

Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.


Solution:

In jump_host check the deployment

kubectl get deployment nginx-deployment -o yaml

Then check the image container name. Here it is nginx-container

Next, set the updated image according to question. Here it is nginx:1.17 image

kubectl set image deployment/nginx-deployment nginx-container=nginx:1.17

Run the watch command to see live rolling update with zero downtime

watch kubectl get pods

Finally check the status

kubectl rollout status deployment nginx-deployment

Then check the image

kubectl get deployment nginx-deployment -o yaml


 

 


Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment