Deployment Rollbacks, Revision History & Pausing Rollouts
Roll back bad releases, inspect revision history, and pause/resume rollouts.
In plain words
A Deployment revision is a labeled conveyor blueprint; rollback changes the blueprint, not any package contents already sent downstream. The simple Kubernetes rule is: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Think of it like…
A Deployment revision is a labeled conveyor blueprint; rollback changes the blueprint, not any package contents already sent downstream.
Where you’ve seen it
During a release or scale event, the workload owner runs kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3. Expected evidence: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior. If the run instead shows this symptom, stop and restore the last known state: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
Words you’ll hear
- Rollback
- For this lesson, Rollback is the controlling idea: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Revision History
- Revision History is the checkpoint; run
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3and inspect the owner chain. Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed. - Pause
- Pause is the outcome to preserve; the cost is explicit: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
- Verification evidence
- The evidence command is
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3. It connects the declaration to this behavior: Roll back bad releases, inspect revision history, and pause/resume rollouts.
Visual diagram
Theory & deep dive
How Rollback reaches the intended state
Roll back bad releases, inspect revision history, and pause/resume rollouts. Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
The concrete checkpoint is kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3; compare the Rollback owner, Revision History state, and Pause outcome instead of treating YAML acceptance as proof.
Run kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3 after the change and correlate the result with Events and the owning object. Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Revision History: failure boundary and production cost
Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed. The prerequisite contract is concrete: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases. A safe design limits blast radius, records the last good configuration, and uses kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3 as a deterministic rollback checkpoint.
Capture the current state with kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
How it works, step by step
Step 1 of 41. Declare workload intent
Write the controller-owned Pod or scaling intent and preserve the owner chain: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Goal
- Roll back bad releases, inspect revision history, and pause/resume rollouts.
- Owner
- Rollback
When to use it & trade-offs
What it is
Roll back bad releases, inspect revision history, and pause/resume rollouts. Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Why it matters: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed. The invariant at risk is specific: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior. The quickest fact check before changing the design is kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3.
When to reach for it
- Use Rollback to enforce this invariant: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Use Revision History evidence from
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3in reviews and incident timelines. Roll back bad releases, inspect revision history, and pause/resume rollouts. - Choose the progressive-delivery layer route only when this cost is justified by governance or scale: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
When to avoid or be careful
- Avoid assuming Rollback is complete after YAML submission; the required behavior is concrete: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Avoid treating the next symptom as random; check the owner and state with
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3first: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed. - Avoid adopting a heavier platform wrapper before measuring its cost: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
Native, manual, and managed paths for Rollback
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3.Strengths: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Watch out: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases. Recovery must also recognize this signal: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3; the expected invariant is: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.Strengths: kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3 gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Rollback, it does not make this symptom self-documenting: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
Watch out: The added platform ownership buys value at this cost: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Trace Rollback to Pause through Revision History; the invariant is: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Recognize the symptom: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
- Justify the cost: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
- Verify with kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3 instead of only inspecting YAML.
Benchmarks & rules of thumb
- 10
- default revisionHistoryLimit for a Deployment
- 1
- undo target step when no revision is named
- 0
- rollback coverage for schema or message migrations by itself
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Rollback owner contract: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior.
- Ignoring this telltale condition leads to unrelated changes: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed.
- Repeating
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3without an owner for remediation wastes retry cost. Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior?
- Which owner object, logs, and Events would you inspect for this symptom-Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed-?
- At what threshold would this cost become unacceptable: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases?
kubectl rollout history deploy/api; kubectl rollout pause deploy/api; kubectl rollout undo deploy/api --to-revision=3, name the failure, then justify the cost. Invariant: Deployment revision history records template rollouts and rollout undo selects a prior ReplicaSet template, while pause stops controller promotion without freezing independent application behavior. Failure: Rollback returns the workload template, not the external database, messages, or feature state that the new version may already have changed. Cost: Keeping many revisions makes diagnosis convenient but adds ReplicaSet metadata; automatic rollback without compatibility tests can oscillate between two bad releases.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Deployment Rollbacks, Revision History & Pausing Rollouts with generative AI interview Q&A and hands-on practice.