How to rollback a deployment?

0 votes
I want to restore my last deployment discarding the changes that i made in the subsequent deployment.How do I rollback to my previous deployment in kubernetes? Please Help.
Jul 12 in Kubernetes by Namik
• 1,210 points
39 views

1 answer to this question.

0 votes

Applying changes to a Deployment process with the --record flag then Kubernetes by default saves the previous Deployment activities in its history. 

The below command will display all the prior Deployments,

                              kubectl rollout history deployment <deployment> 

The last Deployment can be restored with the command, 

                             kubectl rollout undo deployment <deployment> 

The Deployments which are in progress can also be paused and resumed.

The moment new Deployment is applied, during this process a new ReplicaSet object is created which is slowly scaled up while the old ReplicaSet is scaled down.  

We can get the ReplicaSet that has been rolled out with command 

                             kubectl get replicaset 

 Each ReplicaSet is named with the format - 

                          kubectl describe replicaset <replicaset>a
answered Jul 12 by Sirajul
• 40,980 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
423 views
0 votes
1 answer

How to fail a (cron) job after a certain number of retries?

You're trying to set 3 asbackoffLimit of your Job. ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 45,780 points
136 views
0 votes
1 answer

How to start and stop a cluster on AWS using kops without stopping the instance

Export your KOPS_STAT_STORE variable export KOPS_STATE_STORE=s3://your-bucket-name Get your instances ...READ MORE

answered Jan 8 in Kubernetes by Kashish
1,415 views
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,352 views
+3 votes
1 answer
0 votes
1 answer

How to determine what is the status of a deployment ?

You could use kubectl get deployment <deployment>.  If ...READ MORE

answered Jul 12 in Kubernetes by Sirajul
• 40,980 points
42 views
0 votes
1 answer

How to configure a default imagePullSecret for any deployment?

Hey @Sam, you can attach an image ...READ MORE

answered Jul 18 in Kubernetes by Sirajul
• 40,980 points
82 views