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, 2019 in Kubernetes by Namik
• 1,210 points
323 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, 2019 by Sirajul
• 52,850 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
695 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, 2019 in Kubernetes by Sirajul
• 52,850 points
826 views
+1 vote
1 answer

How to use a Volume to communicate between two Containers running in the same Kubernetes-Pod?

Create a Pod that runs two Containers Create a ...READ MORE

answered Jul 23, 2019 in Kubernetes by Sirajul
• 52,850 points
698 views
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, 2019 in Others by anonymous
6,513 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,850 points

reshown Apr 12, 2019 by Kalgi 1,938 views
0 votes
1 answer

How to build a high availability cluster in Kubernetes?

Add nodes in a HA cluster in ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 52,850 points
375 views
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, 2019 in Kubernetes by Sirajul
• 52,850 points
202 views