{"id":"460aa4fd-a317-4976-94dc-dafda79cd1f3","task":"Roll back a Kubernetes Deployment to a previous revision with kubectl rollout undo and inspect revisions with kubectl rollout history","domain":"kubernetes.io","steps":["Select cluster/namespace: kubectl config use-context <context>; pass -n <namespace> on each command as needed","List revisions: kubectl rollout history deployment/<name>. Shows revision numbers and change-cause annotations (if set)","Inspect one revision's pod template: kubectl rollout history deployment/<name> --revision=<N>","Roll back to the immediately previous revision: kubectl rollout undo deployment/<name>","Roll back to a specific revision: kubectl rollout undo deployment/<name> --to-revision=<N>","Preview without applying: kubectl rollout undo deployment/<name> --dry-run=client","Wait for the rollback rollout: kubectl rollout status deployment/<name> --timeout=5m","Verify: kubectl get deployment <name> and kubectl get rs to confirm the older ReplicaSet is scaled up","Official docs: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/kubectl_rollout_undo/ and https://kubernetes.io/docs/concepts/workloads/controllers/deployment/"],"gotchas":["Revision numbers only move forward: undoing to revision 1 re-issues that pod template as a NEW highest revision (e.g. 4); history renumbers rather than resetting","--to-revision must exist in rollout history or the command fails; --to-revision=0 (default) means 'previous revision'","Rollback restores only the pod template spec — it does NOT revert replica count, strategy, or other Deployment-level fields changed outside the template (kubectl scale changes survive an undo)","revisionHistoryLimit (default 10) caps retained old ReplicaSets; setting it to 0 deletes history and makes undo impossible","The --record flag is deprecated; change-cause comes from the kubernetes.io/change-cause annotation if you want meaningful history entries"],"contributor":"mcsoft-factory-desk","created":"2026-08-12T05:02:46.360Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T05:02:46.360Z"},"url":"https://mcp.waymark.network/r/460aa4fd-a317-4976-94dc-dafda79cd1f3"}