Blue-Green & Canary Deployments with Argo Rollouts / Flagger
Progressive delivery with blue-green and canary strategies via Rollouts or Flagger.
In plain words
Blue-green opens a second restaurant before moving the sign, while canary invites a few diners to taste the new menu. The simple Kubernetes rule is: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Think of it like…
Blue-green opens a second restaurant before moving the sign, while canary invites a few diners to taste the new menu.
Where you’ve seen it
During a release or scale event, the workload owner runs kubectl get rollout api; kubectl argo rollouts get rollout api --watch. Expected evidence: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion. If the run instead shows this symptom, stop and restore the last known state: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
Words you’ll hear
- Blue-Green
- For this lesson, Blue-Green is the controlling idea: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Canary
- Canary is the checkpoint; run
kubectl get rollout api; kubectl argo rollouts get rollout api --watchand inspect the owner chain. Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible. - Progressive Delivery
- Progressive Delivery is the outcome to preserve; the cost is explicit: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
- Verification evidence
- The evidence command is
kubectl get rollout api; kubectl argo rollouts get rollout api --watch. It connects the declaration to this behavior: Progressive delivery with blue-green and canary strategies via Rollouts or Flagger.
Visual diagram
Theory & deep dive
How Blue-Green reaches the intended state
Progressive delivery with blue-green and canary strategies via Rollouts or Flagger. Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
The concrete checkpoint is kubectl get rollout api; kubectl argo rollouts get rollout api --watch; compare the Blue-Green owner, Canary state, and Progressive Delivery outcome instead of treating YAML acceptance as proof.
Run kubectl get rollout api; kubectl argo rollouts get rollout api --watch after the change and correlate the result with Events and the owning object. Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Canary: failure boundary and production cost
Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible. The prerequisite contract is concrete: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility. A safe design limits blast radius, records the last good configuration, and uses kubectl get rollout api; kubectl argo rollouts get rollout api --watch as a deterministic rollback checkpoint.
Capture the current state with kubectl get rollout api; kubectl argo rollouts get rollout api --watch, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
How it works, step by step
Step 1 of 41. Declare workload intent
Write the controller-owned Pod or scaling intent and preserve the owner chain: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Goal
- Progressive delivery with blue-green and canary strategies via Rollouts or Flagger.
- Owner
- Blue-Green
When to use it & trade-offs
What it is
Progressive delivery with blue-green and canary strategies via Rollouts or Flagger. Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Why it matters: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible. The invariant at risk is specific: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion. The quickest fact check before changing the design is kubectl get rollout api; kubectl argo rollouts get rollout api --watch.
When to reach for it
- Use Blue-Green to enforce this invariant: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Use Canary evidence from
kubectl get rollout api; kubectl argo rollouts get rollout api --watchin reviews and incident timelines. Progressive delivery with blue-green and canary strategies via Rollouts or Flagger. - Choose the progressive-delivery layer route only when this cost is justified by governance or scale: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
When to avoid or be careful
- Avoid assuming Blue-Green is complete after YAML submission; the required behavior is concrete: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get rollout api; kubectl argo rollouts get rollout api --watchfirst: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible. - Avoid adopting a heavier platform wrapper before measuring its cost: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
Native, manual, and managed paths for Blue-Green
kubectl get rollout api; kubectl argo rollouts get rollout api --watch.Strengths: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Watch out: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility. Recovery must also recognize this signal: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
kubectl get rollout api; kubectl argo rollouts get rollout api --watch; the expected invariant is: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.Strengths: kubectl get rollout api; kubectl argo rollouts get rollout api --watch gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Blue-Green, it does not make this symptom self-documenting: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
kubectl get rollout api; kubectl argo rollouts get rollout api --watch.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
Watch out: The added platform ownership buys value at this cost: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Trace Blue-Green to Progressive Delivery through Canary; the invariant is: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Recognize the symptom: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
- Justify the cost: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
- Verify with kubectl get rollout api; kubectl argo rollouts get rollout api --watch instead of only inspecting YAML.
Benchmarks & rules of thumb
- 2
- environments are active in a blue-green pattern
- 1%
- a sensible tiny starting canary for some traffic, adjusted to sample size
- 100%
- promotion completes only after the new revision receives all traffic
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Blue-Green owner contract: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion.
- Ignoring this telltale condition leads to unrelated changes: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible.
- Repeating
kubectl get rollout api; kubectl argo rollouts get rollout api --watchwithout an owner for remediation wastes retry cost. Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion?
- Which owner object, logs, and Events would you inspect for this symptom-Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible-?
- At what threshold would this cost become unacceptable: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility?
kubectl get rollout api; kubectl argo rollouts get rollout api --watch, name the failure, then justify the cost. Invariant: Blue-green keeps parallel service environments and switches traffic, while canary shifts a small percentage to a new Revision and evaluates metrics before promotion. Failure: Bad metrics, missing request identity, or sticky sessions can make a canary appear healthy while a stateful backend remains incompatible. Cost: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Blue-Green & Canary Deployments with Argo Rollouts / Flagger with generative AI interview Q&A and hands-on practice.