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.
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
/$ |
thor@jump_host
/$ kubectl set image deployment nginx-deployment nginx-container=nginx:1.19 deployment.apps/nginx-deployment
image updated thor@jump_host
/$ |
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
/$ 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
/$ |
thor@jump_host
/$ kubectl rollout status deployment nginx-deployment deployment
"nginx-deployment" successfully rolled out thor@jump_host
/$ |
Happy Learning !!!!
0 Comments