liveBook · Manning

Rollback

As explained in Kubernetes in Action, Second Edition

A rollback is the reversion of a deployed application workload to an earlier version or revision.

Rollback reverts a deployed workload to an earlier version or revision when an update fails. For a Deployment, kubectl rollout undo performs the reversal using the Deployment’s configured update strategy, so a RollingUpdate rollback replaces Pods gradually. section 15.2.6

Use rollback controls according to the workload and its update strategy:

  • Undo the latest Deployment update with kubectl rollout undo deployment kiada; run it during an active rollout to cancel that rollout or afterward to revert it. section 15.2.6
  • Inspect available revisions with kubectl rollout history deploy kiada, then examine a specific revision with --revision before selecting it. section 15.2.6
  • Target an older revision explicitly with kubectl rollout undo deployment kiada --to-revision=1. section 15.2.6
  • Treat OnDelete StatefulSet rollback as semi-automatic: delete each Pod yourself, allowing the controller to recreate it from the previous revision. section 16.3.3

Rolling back a Deployment

After a failed update, run kubectl rollout undo deployment kiada. Kubernetes restores the previous revision while respecting the Deployment strategy. To restore a particular earlier revision, inspect its Pod template and run kubectl rollout undo deployment kiada --to-revision=1. section 15.2.6

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains commands, revision inspection, rollout timing, paused Deployments, and manual OnDelete Pod replacement, but not revision storage internals.
Examples
Uses kubectl rollout undo, rollout history, targeted revision commands, and manually deleted StatefulSet Pods as operational examples.
What it assumes
Assumes familiarity with Deployments or StatefulSets, Pods, revisions, and update strategies while demonstrating the rollback commands directly.
What you can do after
Operate/configure rollback with kubectl, inspect revisions, select an older Deployment revision, and manually complete OnDelete StatefulSet rollback.
How it connects
Connects rollback with Deployments, StatefulSets, rolling updates, rollout history, update strategies, Pod readiness, and paused rollouts.

Also explained in

Compare how 8 books explain rollback →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.