How to deploy a feature with zero downtime in kubernetes?

+1 vote
Could you illustrate with an example How do i deploy a feature with zero downtime in kubernetes?
Jul 18 in Kubernetes by Namik
• 1,210 points
281 views

1 answer to this question.

+1 vote
  • By default Deployment in Kubernetes uses 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 7s
  • Now let’s assume we are going to update the nginx image

kubectl set image deployment nginx nginx=nginx:1.15 # updates the image
  • Now when we check the replica sets

kubectl get replicasets # get replica sets

NAME               DESIRED CURRENT READY   AGE
nginx-65899c769f   0 0 0       7m
nginx-6c9655f5bb   1 1 1       13s
  • From 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>
answered Jul 18 by Sirajul
• 41,000 points

Related Questions In Kubernetes

0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,280 points
437 views
0 votes
1 answer

how to scale a statefulset in kubernetes?

Scaling StatefulSets : Use kubectl to scale StatefulSets First, ...READ MORE

answered Jul 23 in Kubernetes by Sirajul
• 41,000 points
262 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
3,526 views
+3 votes
1 answer
0 votes
1 answer
0 votes
1 answer

how to test a manifest without actually executing it in kubernetes?

You can use --dry-run flag to test the manifest.  This ...READ MORE

answered Jul 18 in Kubernetes by Sirajul
• 41,000 points
59 views