liveBook · Manning

Rollback

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

Rollback is the restoration of an application to a previous known configuration or version after a change.

Rollback restores a Kubernetes Deployment to a previous recorded revision after a change introduces a bug or otherwise requires rapid reversal. Kubernetes creates a new revision whenever pods change; undoing a revision creates another revision rather than decreasing the revision number. section 5.1.3

Use this operational sequence to reverse a problematic Deployment change:

  • Inspect revisions with kubectl rollout history deploy <name>. section 5.1.3
  • Record the reason for a change with the kubernetes.io/change-cause annotation. section 5.1.3
  • Revert the Deployment with kubectl rollout undo deploy <name>. section 5.1.3
  • Verify completion with kubectl rollout status deploy <name>, then annotate the new revision when useful. section 5.1.3

Reverting a faulty image update

After changing the Apache image and discovering a bug, run kubectl rollout undo deploy apache. The Deployment returns to the previous application version, while its history records the rollback as a new revision. Add the note reverted back to the original and confirm success with kubectl rollout status deploy apache.

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains revision history, annotations, undo behavior, and status verification, but does not detail rollback internals.
Examples
Uses an Apache Deployment, image-tag change, rollout history, change-cause annotations, undo output, and rollout-status verification.
What it assumes
Assumes a running Kubernetes Deployment and familiarity with application changes such as updating a container image.
What you can do after
Operate/configure Deployments with kubectl rollout undo, annotate rollback reasons, and verify successful recovery.
How it connects
Connects Kubernetes Deployments with rolling updates, rollout history, revisions, annotations, and kubectl rollout.

Also explained in

Compare how 8 books explain rollback →

Related concepts

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