Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 38/ 160
02. Workload Controllers & Scaling

Blue-Green & Canary Deployments with Argo Rollouts / Flagger

Progressive delivery with blue-green and canary strategies via Rollouts or Flagger.

AdvancedBlue-Green · Canary · Progressive Delivery3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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 --watch and 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

Loading interactive 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.

Verify Canary, not only object creation

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.

Key takeaway: Blue-Green is implemented only when this invariant remains observable: 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.

Recover from Canary drift

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.

Key takeaway: Accept the trade-off consciously: Canaries limit blast radius and blue-green enables fast switchback, but both require duplicate capacity, strong observability, and application compatibility.

How it works, step by step

Step 1 of 4
Workload author

1. 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.

Blue-Green contract → owned state
Key numbers at this step
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 --watch in 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 --watch first: 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

Controller-managed workload
Best for: Progressive delivery with blue-green and canary strategies via Rollouts or Flagger. A concrete incident check is 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.

Hand-managed Pods
Best for: Quickly testing the Canary assumption with 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.

Progressive-delivery layer
Best for: Teams that need Progressive Delivery integrated with guardrails; the evidence path is 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 --watch without 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?
Interview tip: Interview sequence: state the invariant, run 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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
ResourceQuotas & LimitRanges per Namespace
Next topic
Lifecycle Management of AI/ML & GPU Workloads on Kubernetes