The Desi Architect
Notes / Docker Sandboxes / Rolling Updates, Rollbacks and Graceful Shutdown
Docker Sandboxes · Tier 5: Orchestrate: Kubernetes on your laptop · Lab 63

Rolling Updates, Rollbacks and Graceful Shutdown

Upgrade production workloads with zero downtime using Kubernetes RollingUpdate strategies. Deploy version 2.0 under continuous traffic, stall a broken release safely with maxUnavailable=0, undo with a single command, and handle SIGTERM on 127.0.0.1:18303.

Time40 minutes
StackKubernetes v1.37Ports 18303
Memory1.3GB
Before thisLab 62Readiness, Liveness and Startup Pr
Verified runWindows, Mac, LinuxBash and PowerShell
  1. 1PrepareWhat you will learn
  2. 2PredictGuess before you run
  3. 3RunStep by step
  4. 4ObserveWhat you should see
  5. 5Break itChange one thing
  6. 6Clean upLeave nothing running
On this page
  1. 00 / What You Will Learn
  2. 01 / Why It Matters
  3. 02 / What We Are Building
  4. 03 / Words You Need
  5. 04 / Predict First
  6. 05 / Step by Step
  7. 06 / What You Should See
  8. 07 / Look Inside
  9. 08 / Break It, Fix It
  10. 09 / In Real Projects
  11. 10 / Interview Corner
  12. 11 / Clean Up

00 /What You Will Learn

By the end you will be able to
  • Execute a zero-downtime RollingUpdate with maxUnavailable: 0 and maxSurge: 1.
  • Observe how Readiness probes prevent premature traffic cutover to unready pods during upgrades.
  • Witness how Kubernetes automatically stalls a broken deployment without terminating healthy replicas.
  • Revert a broken rollout instantly to the previous stable revision using kubectl rollout undo.
  • Configure SIGTERM handling and terminationGracePeriodSeconds to achieve graceful connection draining.

Before you start

Finish Lab 62 (Readiness, Liveness and Startup Probes) first. You should understand how probes gate traffic in the endpoints controller. Give Docker at least 4 GB of memory, and make sure kind and kubectl are installed.