kubectl rollout undo reverts a Kubernetes Deployment or StatefulSet to an earlier recorded revision. Use it when an update fails, hangs, or needs to be reversed after completion. section 15.2.6 section 16.3.1
The rollback follows the workload’s configured update behavior:
- Undo the last revision with kubectl rollout undo deployment NAME or kubectl rollout undo sts NAME. section 15.2.6 section 16.3.1
- Return to a particular revision with --to-revision=NUMBER. section 15.2.6 section 16.3.1
- Let RollingUpdate replace pods gradually; a paused Deployment does nothing until resumed. section 15.2.6 section 16.3.1
- Inspect available revisions with rollout history and examine an individual revision with --revision. section 15.2.6
Undo a failed Deployment update
Run `kubectl rollout undo deployment kiada` to restore the previous recorded revision. To select an older revision instead, run `kubectl rollout undo deployment kiada --to-revision=1`.
$ kubectl rollout history deploy kiada --revision 2
deployment.apps/kiada with revision #2
Pod Template:
Labels: app=kiada
pod-template-hash=7bffb9bf96
rel=stable
Containers:
kiada:
Image: luksa/kiada:0.6
...
Inspect a revision’s pod template before choosing it, including labels and the container image recorded for that revision. section 15.2.6
