liveBook · Manning

Kubectl rollout undo

As explained in Kubernetes in Action, Second Edition

kubectl rollout undo is a kubectl command that reverts a Kubernetes workload to an earlier recorded revision.

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 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

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains commands, revision selection, update-strategy behavior, history inspection, and paused-Deployment limitations.
Examples
Demonstrates undoing the kiada Deployment, selecting revision 1, and inspecting revision 2’s pod template.
What it assumes
Assumes familiarity with Deployments or StatefulSets, pod updates, rollout strategies, and recorded revisions.
What you can do after
Operate rollbacks with kubectl, select target revisions, and inspect rollout history before reverting workloads.
How it connects
Connects rollbacks to Deployments, StatefulSets, RollingUpdate, rollout history, and ControllerRevision objects.

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.