How does a rollback work in a Deployment?
IntermediateConceptPods & Workloads
Answer
kubectl rollout undo sets the Pod template back to the previous ReplicaSet's template, which scales up again while the current one scales down. History comes from revisionHistoryLimit (default 10). Only template changes create revisions; scaling does not. Use --to-revision=N for a specific one.
kubectl rollout history deploy/web
kubectl rollout undo deploy/web --to-revision=3