05 · Change safety
Safe rollouts and recovery
A rollout tracks deployment progress. Recovery means real operations work again. Verify both.
- 2-minute guide
- All field guides
The model
Expose a small canary group to a change while keeping a control group unchanged. Compare similar request mixes over the same window; an absolute error threshold can miss a regression.
Know the reversal boundary first. A Deployment revision contains its Pod template. Rolling it back does not restore a ConfigMap edited in place, a Service, or database data. Check compatibility before reversing a release.
Worked example
In 1,000 comparable requests per group, control has 5 failures and canary has 50. That is 0.5% versus 5%: ten times the error rate. Pause expansion and inspect the change, even if every pod reports Ready.
This comparison supports a release-related regression, not a complete diagnosis. Shared dependencies can affect both groups. After a bounded mitigation, repeat a real operation and watch sustained success and latency—not just rollout status.
Commands worth running
Example resource names are fictional. Inspect the intended namespace before acting.
kubectl rollout history \
deployment/ledger --revision=11Read a specific revision’s template. Do not assume “previous” means the known-good version after several releases.
kubectl get configmap ledger-config -o yamlInspect separately versioned configuration. A template referencing this name does not freeze its contents.
kubectl rollout status \
deployment/ledger --timeout=60sBound the status watch to a minute. Success establishes rollout progress, not successful user operations; timeout does not cancel the rollout.
Self-check
A template rollback completes but failures persist. What would you inspect next?
Show answer
The real request path and changes outside the template, especially separately managed configuration or data. A green rollout is not a recovery verdict.
References
- Kubernetes: Deployment revisions
- Kubernetes: ConfigMaps
- kubectl rollout status
- Google SRE: canarying releases