{
  "id": 21941456,
  "title": "We ran kubectl rollout undo twice to go back two versions and the second one restored the release we had just removed",
  "url": "https://urgent.news/2026/11/26/we-ran-kubectl-rollout-undo-twice-to-go-back-two-versions-and-the",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T07:21:03.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sergey_shinder_ab2d943365/we-ran-kubectl-rollout-undo-twice-to-go-back-two-versions-and-the-second-one-restored-the-release-4pfa"
  },
  "original_language": "en",
  "account": "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.",
  "summary": "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…",
  "key_points": [
    "Engineer rolled back version 4.17 using kubectl rollout undo twice",
    "First undo restored version 4.16, second undo restored version 4.17",
    "Rollback process should use version-specific script for clearer history"
  ],
  "editors_take": "Relying on default rollback commands creates dangerous circular revision loops, necessitating standardized scripts that target specific image versions to ensure predictable deployment histories during critical service failures.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}