How would you do a canary release with only Deployments and a Service?
IntermediateScenarioDeployments and rollouts
Answer
Situation read → You want 10% of traffic on the new version without Argo Rollouts or a mesh.
What I'd do →
- Create
app-stablewith 9 replicas andapp-canarywith 1 replica, both carryingapp: web - The Service selects only
app: web, so traffic splits roughly by pod count - Watch error rate and latency of the canary pods in Prometheus
- Scale the canary up and the stable down in steps, or delete the canary on failure
- Finish by updating the stable image and removing the canary
Why → kube-proxy balances across all ready endpoints, so replica ratio approximates traffic ratio. It is coarse, but needs no extra tooling.
Interview tip → Say that for exact percentages or header routing you would use Argo Rollouts, Flagger, or Gateway API weights.
More on Deployments and rollouts
You applied a new image tag and the rollout seems stuck at "1 out of 3 new replicas have been updated". What do you check first?BeginnerHow do you roll back a bad release and verify you are back on the previous version?BeginnerA rollout must never reduce capacity below current replicas. How do you configure the strategy?IntermediateYou need a blue/green deployment without a service mesh. How do you do it with plain Kubernetes?IntermediateWhat is the difference between Recreate and RollingUpdate strategies and when would you pick Recreate?BeginnerAfter a deploy, pods are Ready but users get 502s for a few seconds. What is happening and how do you fix it?Intermediate