How would you set up a canary release, and what decides whether it gets promoted?
IntermediateScenarioDeployments and releases
Answer
Situation read → A canary is only as good as its promotion criteria. Shifting 5% of traffic without automated analysis is just a slow rollout.
What I'd do →
- Use Argo Rollouts (or Flagger) with weighted steps:
strategy:
canary:
steps:
- setWeight: 5
- pause: {duration: 10m}
- analysis: {templates: [{templateName: success-rate}]}
- setWeight: 25
- pause: {duration: 10m}
- setWeight: 100
- Define an AnalysisTemplate querying Prometheus: error rate of the canary below 1%, p99 below the stable version plus 10%.
- Compare canary against stable, not against a fixed number, so normal daily traffic changes don't cause false failures.
- Auto-abort on failure; Argo shifts traffic back to stable.
- Watch business metrics too (checkout completions), not only HTTP codes.
Why → Automated analysis removes the human staring at dashboards and makes rollback instant.
Interview tip → Say what metric would block promotion; "we watched it" is not an answer.
More on Deployments and releases
A deploy went out and p99 latency doubled. Walk me through it.IntermediateYou deployed a new version and half the pods are in CrashLoopBackOff. What do you do?BeginnerA release passed every test in staging but broke in production. How do you investigate?IntermediateHow would you design a zero-downtime deployment for a stateless API on Kubernetes?BeginnerEvery deploy causes a short spike of 502 errors from the ALB. Why, and how do you fix it?IntermediateBlue-green or canary? How do you choose for a specific service?Beginner