liveBook · Manning

Kubectl rollout history

As explained in Kubernetes in Action, Second Edition

kubectl rollout history is a kubectl command that displays the recorded revisions of a Kubernetes workload.

kubectl rollout history displays the recorded revisions of a Kubernetes workload, helping you inspect earlier versions before choosing whether to roll back. section 15.2.6

Use the command to:

  • List revisions for a Deployment with kubectl rollout history deploy <name>. section 15.2.6
  • Inspect one revision with --revision, including its pod-template labels and container image. section 15.2.6
  • List StatefulSet revisions with kubectl rollout history sts <name>. section 16.3.1

Inspect a Deployment revision

$ kubectl rollout history deploy kiada REVISION CHANGE-CAUSE 1 <none> 2 <none> 11 <none> $ kubectl rollout history deploy kiada --revision 2 Pod Template: Containers: kiada: Image: luksa/kiada:0.6 The CHANGE-CAUSE column may be empty. The --record option populated it in older workflows, but that option is deprecated. section 15.2.6

Revision history is stored through controller-managed objects rather than only in the current workload manifest. Deployments retain ReplicaSets, with each ReplicaSet representing a revision. StatefulSets use immutable ControllerRevision snapshots; DaemonSets use the same object type. section 15.2.6 section 16.3.1

Figure 15.10 A Deployment’s revision history
figure

Use the revision-history diagram to connect workload revisions with the controller-managed objects that preserve them. section 15.2.6

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains listing and inspection commands, change-cause limitations, and storage through ReplicaSets or ControllerRevision objects.
Examples
Demonstrates Deployment and StatefulSet history listings plus detailed inspection of a Deployment revision.
What you can do after
Evaluate recorded revisions and inspect pod-template details before using rollout undo to return to an earlier revision.
How it connects
Connects Deployments and StatefulSets with ReplicaSets, ControllerRevision objects, rollback, and revision history limits.

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.