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, 2019 in Kubernetes by Namik
• 1,230 points
1,291 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, 2019 by Sirajul
• 59,230 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,300 points
2,467 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
• 52,350 points
3,115 views
+1 vote
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
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
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, 2019 in Kubernetes by Sirajul
• 59,230 points
660 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, 2019 in Kubernetes by Sirajul
• 59,230 points
2,018 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP