Urgent.News

What's breaking now, across hundreds of outlets.

Tech

We ran kubectl rollout undo twice to go back two versions and the second one restored the release we had just removed

Our label service runs as a Deployment, and for years our rollback has been kubectl rollout undo. The runbook said: if a release misbehaves, undo it first and investigate after. On a Thursday this month version 4.17 went out at ten past two. Within minutes depot printers started rejecting a share of labels, and the engineer on call ran kubectl rollout undo. The pods went back to 4.16. Errors fell…

Our label service, running as a Deployment, relied on kubectl rollout undo for rollbacks. However, on a Thursday this month, version 4.17 caused issues and needed to be rolled back. The engineer on call executed kubectl rollout undo twice, reverting back to versions 4.16 and then 4.15. To their surprise, the second undo restored version 4.17.

The Deployment's history consists of pod templates for each ReplicaSet, numbered by revision. Undo without arguments refers to the previous revision. The first undo didn't create anything; instead, Kubernetes scaled the ReplicaSet for 4.16 back up, assigning it number 32, while revision 30 was removed from history. The second undo moved to revision 31, which corresponded to version 4.17, and incremented it to 33.

Undo only switches between the last two versions and never moves further back. The rollback process should be standardized using a version-specific script that references the image from the release record. The new rollback script sets the Deployment's image based on the version, while the kubernetes.io/change-cause annotation records each release's version.

This change allows for a clearer rollback history and prevents confusion caused by error messages from previous versions.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Rotating session encryption keys without logging everyone out

Rotating session encryption keys without logging everyone out Session encryption keys are easy to forget because they often work silently.

  • OWASP guidelines outline key lifecycle management and cryptoperiods.
  • Inventory all key instances: session cookies, server-side records, cache values.
  • Verify-only deployment allows old and new keys to coexist during rotation.

More from Thursday 26 November →