Progressive rollout and rollback
Rolling updates replace Pods gradually
A Deployment rolling update creates Pods using a new template while reducing old replicas. For four desired replicas with maxUnavailable: 0 and maxSurge: 1, the intended update budget permits one extra non-terminating Pod and requires the controller to preserve four available replicas during normal rollout decisions. This is not a guarantee of uptime: failures, capacity shortages, connection draining and terminating Pods affect reality. A rollout deadline reports lack of progress; the Deployment controller does not automatically undo a failed release.
strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 0 maxSurge: 1Canary versus blue-green
Canary delivery exposes a candidate to a small subset of requests or users before expanding exposure. Blue-green maintains two environments and switches traffic after the candidate passes checks. A pair of Deployments sharing a Service selector can provide a basic canary, but replica ratios are not exact request weights: persistent connections, topology and client behavior influence distribution. For explicit weights, use a compatible traffic manager and a controller that supports it, such as a verified Argo Rollouts integration. The lesson does not require installing an add-on. Feature flags separately control behavior inside an application; an image rollback does not necessarily reset flag state.
Measure before increasing exposure
The fictional catalog canary serves 200 requests with 12 failures, giving a 6% error rate. The exercise policy pauses if fewer than 100 requests are observed, aborts when errors exceed 2% or p95 latency exceeds 300 ms, and advances only when readiness and smoke tests pass. These are sample thresholds, not production recommendations. Check the stable cohort too; an upstream outage could affect both. Never treat missing telemetry as zero errors. Measure at each step and keep a stop decision independent from the rollout controller.
candidate requests: 200failed requests: 12error rate: 6%decision: ABORTRollback the application deliberately
First stop increasing traffic, capture relevant evidence, and restore traffic to the known healthy version if safe. A Deployment rollback restores a previous Pod template if the revision is retained. It does not roll back database data, external settings or all changed objects. Reconcile the declarative source so a later pipeline or GitOps sync does not reapply the failed release. The commands below are inspection-only examples for a separately approved disposable lab; the supplied images cannot run. A successful rollout status is not proof of business correctness.
kubectl --kubeconfig ./approved-lab.kubeconfig --context bytemind-lab -n delivery-lab rollout history deployment/catalog-canarykubectl --kubeconfig ./approved-lab.kubeconfig --context bytemind-lab -n delivery-lab rollout status deployment/catalog-canary --timeout=90sPractice: decide whether to promote
Use rollout-cases.json to decide ADVANCE, HOLD or ABORT. Explain the difference between not enough evidence and a confirmed bad release. A failed smoke test must stop promotion even when all Pods are Ready. Explain how to keep a stable version available and why rollback needs a compatible database.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Progressive rollout and rollback — knowledge check
Reason about application delivery using offline fixtures.
Which approach gradually replaces a Deployment’s Pods?
Do one canary Pod and nine stable Pods guarantee exactly 10% of HTTP requests to canary?
The sample gate sees 12 failures in 200 requests. What decision follows?
What should missing telemetry normally trigger in this fixture?
What does Deployment rollback restore?