Rolling updates in Kubernetes

Ticker

6/recent/ticker-posts

Rolling updates in Kubernetes

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

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

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



Please Note :-  Perform the below commands based on your question  server,  user name & other details might differ . So please read task carefully before executing. All the Best 👍

Solution:  

1. At first  check existing deployment and  pods running status   

thor@jump_host /$ kubectl get deploy

NAME               READY   UP-TO-DATE   AVAILABLE   AGE

nginx-deployment   3/3     3            3           28s

thor@jump_host /$

thor@jump_host /$ kubectl get pods

NAME                                READY   STATUS    RESTARTS   AGE

nginx-deployment-74fb588559-bp5bw   1/1     Running   0          33s

nginx-deployment-74fb588559-c6d6p   1/1     Running   0          33s

nginx-deployment-74fb588559-g5jnz   1/1     Running   0          33s

thor@jump_host /$



2.  According the task set the  container image & deployment name

thor@jump_host /$ kubectl set image deployment nginx-deployment nginx-container=nginx:1.19

deployment.apps/nginx-deployment image updated

thor@jump_host /$

    
3. wait for  deployment and  pods running status
    

thor@jump_host /$ kubectl get pods

NAME                                READY   STATUS              RESTARTS   AGE

nginx-deployment-57bf6d6978-q8dnt   0/1     ContainerCreating   0          5s

nginx-deployment-74fb588559-bp5bw   1/1     Running             0          60s

nginx-deployment-74fb588559-c6d6p   1/1     Running             0          60s

nginx-deployment-74fb588559-g5jnz   1/1     Running             0          60s

thor@jump_host /$

thor@jump_host /$ kubectl get deploy

NAME               READY   UP-TO-DATE   AVAILABLE   AGE

nginx-deployment   3/3     3            3           76s

thor@jump_host /$

thor@jump_host /$ kubectl get pods

NAME                                READY   STATUS    RESTARTS   AGE

nginx-deployment-57bf6d6978-2jtkg   1/1     Running   0          16s

nginx-deployment-57bf6d6978-dhps8   1/1     Running   0          14s

nginx-deployment-57bf6d6978-q8dnt   1/1     Running   0          25s

thor@jump_host /$

    
4. Check the rollout deployment status
    

thor@jump_host /$ kubectl rollout status deployment nginx-deployment

deployment "nginx-deployment" successfully rolled out

thor@jump_host /$                                                                             



5.  Click on Finish & Confirm to complete the task successful

Happy Learning !!!!

Apart from this if you need more clarity,  I have made a  tutorial video on this , 

please go through and share your comments. Like and share the knowledge



Post a Comment

0 Comments

Latest Posts

Secure Root SSH Access Level 1 Linux KodeKloud Engineer Task Success