Saved Bookmarks
| 1. |
How do you deploy a feature with zero downtime in Kubernetes? |
|
Answer» By default Deployment in Kubernetes using RollingUpdate as a strategy. Let's say we have an EXAMPLE that CREATES a deployment in Kubernetes kubectl run nginx --IMAGE=nginx # creates a deployment ○ → kubectl get deploy NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE nginx 1 1 1 0 7sNow let’s assume we are going to update the nginx image kubectl set image deployment nginx nginx=nginx:1.15 # updates the imageNow when we check the replica sets kubectl get replicasets # get replica setsNAME DESIRED CURRENT READY AGE nginx-65899c769f 0 0 0 7m nginx-6c9655f5bb 1 1 1 13sFrom the above, we can notice that one more replica set was added and then the other replica set was brought down kubectl rollout status deployment nginx# check the status of a deployment rollout kubectl rollout history deployment nginx# check the revisions in a deployment ○ → kubectl rollout history deployment nginx deployment.extensions/nginx REVISION CHANGE-CAUSE 1 <NONE> 2 <none> |
|