Skip to content

Instantly share code, notes, and snippets.

@keyan1603
Created September 20, 2023 18:07
Show Gist options
  • Save keyan1603/6526c8b94f3c2be5ea1367ecb052d3a1 to your computer and use it in GitHub Desktop.
Save keyan1603/6526c8b94f3c2be5ea1367ecb052d3a1 to your computer and use it in GitHub Desktop.
Revert to Previous release – Disaster recovery in Kubernetes
# Revert to previous deployment
kubectl rollout undo deployments/<deployment name>
#Example: To revert CD deployment to the previous state
kubectl rollout undo deployments/cd
# To get the Revisions which were deployed
kubectl rollout history deployment/<deployment name>
#Example: To get the Revision history of CM
kubectl rollout history deployment/cm
# To get the detail of the Revision rolled out
kubectl rollout history deployment/<deployment name> --revision=<revision number>
#Example: To get the details of the specific Revision history
kubectl rollout history deployment/cm --revision=75
# Revert to Specific deployment Revision
kubectl rollout undo deployment/<deployment name> --to-revision=<revision number>
#Example: To revert to specific Revision version
kubectl rollout undo deployment/cm --to-revision=75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment