Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a canary deployment?
A canary deployment is a way to release a new version of software to a small group of users first. It helps check if the new version works well before giving it to everyone.
Click to reveal answer
beginner
Why use canary deployments in Kubernetes?
Canary deployments let you test new app versions safely by sending only some traffic to the new version. This reduces risk and helps catch problems early.
Click to reveal answer
intermediate
How do you control traffic split in a canary deployment?
You control traffic split by adjusting the number of pods or using service routing rules to send a percentage of user requests to the new version.
Click to reveal answer
intermediate
What Kubernetes resource can help manage canary deployments?
Tools like Kubernetes Deployments with multiple ReplicaSets or service mesh tools (e.g., Istio) help manage canary deployments by controlling traffic and rollout.
Click to reveal answer
beginner
What is the main benefit of canary deployments?
The main benefit is reducing risk by testing new versions with a small user group before full release, allowing quick rollback if issues appear.
Click to reveal answer
What does a canary deployment primarily help with?
ABacking up data automatically
BIncreasing the number of servers instantly
CEncrypting network traffic
DReducing risk by testing new versions with limited users
✗ Incorrect
Canary deployments reduce risk by releasing new versions to a small group first.
In Kubernetes, how can you send only some traffic to a new version during a canary deployment?
ABy adjusting pod replicas or using service routing rules
BBy deleting old pods immediately
CBy changing the container image tag only
DBy restarting the cluster
✗ Incorrect
Traffic split is controlled by pod replicas or routing rules.
Which tool can help manage traffic routing for canary deployments in Kubernetes?
ADocker Compose
BIstio
CGit
DJenkins
✗ Incorrect
Istio is a service mesh that manages traffic routing for canary deployments.
What should you do if the canary version shows problems?
AIncrease traffic to the canary immediately
BDelete all pods
CRollback to the previous stable version
DIgnore and continue
✗ Incorrect
Rollback helps avoid impacting all users if the new version has issues.
Canary deployments are an example of which type of deployment strategy?
AIncremental rollout
BBlue-green deployment
CRecreate deployment
DShadow deployment
✗ Incorrect
Canary deployments roll out changes incrementally to a subset of users.
Explain what a canary deployment is and why it is useful in Kubernetes.
Think about testing new versions safely before full release.
You got /4 concepts.
Describe how you would implement a canary deployment in Kubernetes.
Consider how to split traffic and manage versions.
You got /5 concepts.
Practice
(1/5)
1. What is the main purpose of a canary deployment in Kubernetes?
easy
A. To release a new version to a small group of users first to reduce risk
B. To deploy all users to the new version immediately
C. To delete the old version before deploying the new one
D. To run multiple versions permanently without any rollout
Solution
Step 1: Understand canary deployment concept
Canary deployments release new software versions to a small subset of users first to test stability and reduce risk.
Step 2: Compare options with this concept
Only To release a new version to a small group of users first to reduce risk describes this gradual rollout to a small group to reduce risk.
Final Answer:
To release a new version to a small group of users first to reduce risk -> Option A
Quick Check:
Canary deployment = gradual rollout [OK]
Hint: Canary means small test group rollout first [OK]
Common Mistakes:
Thinking canary deploys to all users at once
Confusing canary with blue-green deployment
Assuming canary deletes old versions immediately
2. Which Kubernetes resource is typically used to manage canary deployments?
easy
A. Deployment
B. ConfigMap
C. ServiceAccount
D. PersistentVolume
Solution
Step 1: Identify resource for managing app versions
Deployments manage application versions and rollout strategies in Kubernetes.
Step 2: Match resource to canary deployment
Canary deployments use multiple Deployments with different labels to control traffic.
Final Answer:
Deployment -> Option A
Quick Check:
Canary uses Deployment resource [OK]
Hint: Deployments control app versions and rollout [OK]
Common Mistakes:
Choosing ConfigMap which stores config, not versions
Selecting ServiceAccount which manages permissions
Picking PersistentVolume which handles storage
3. Given this snippet of a Kubernetes Deployment YAML for canary rollout, what percentage of traffic will go to the canary pods?
Assuming the stable deployment has 8 replicas with label version: stable and the Service routes traffic evenly by label.
medium
A. 20%
B. 25%
C. 80%
D. 50%
Solution
Step 1: Calculate total replicas
Stable has 8 replicas, canary has 2 replicas, total = 8 + 2 = 10 replicas.
Step 2: Calculate canary traffic percentage
Traffic is split evenly by label, so canary gets 50% traffic regardless of pod count.
Final Answer:
50% -> Option D
Quick Check:
Service splits traffic evenly by label = 50% canary [OK]
Hint: Check how Service splits traffic: by pods or labels [OK]
Common Mistakes:
Assuming traffic splits by pod count instead of labels
Ignoring label-based routing in Service
Miscounting total replicas
4. You applied a canary Deployment but users report they see only the old version. What is the most likely cause?
medium
A. The image tag in the canary Deployment is incorrect
B. The Deployment replicas are set to zero
C. The Service selector does not include the canary label
D. The pod resource limits are too high
Solution
Step 1: Understand how Service routes traffic
Service routes traffic to pods matching its selector labels.
Step 2: Identify why canary pods get no traffic
If Service selector misses canary label, canary pods won't receive traffic, so users see only old version.
Final Answer:
The Service selector does not include the canary label -> Option C
Quick Check:
Service selector missing canary label = no canary traffic [OK]
Hint: Check Service selector matches canary pod labels [OK]
Common Mistakes:
Assuming zero replicas without checking
Blaming image tag without logs
Ignoring Service selector labels
5. You want to roll out a canary deployment with 10% traffic to the new version and 90% to stable. You have 10 stable pods and 2 canary pods. How should you configure the Service to achieve this traffic split?
hard
A. Set Service selector to include both stable and canary labels and use weighted routing with 10% weight on canary
B. Create two Services, one for stable and one for canary, and use an Ingress with traffic splitting
C. Use a single Deployment with 12 replicas and update image tag gradually
D. Set Service selector to only stable label and manually scale canary pods to 1
Solution
Step 1: Understand traffic splitting in Kubernetes Service
Standard Kubernetes Service does not support weighted traffic splitting by itself.
Step 2: Identify method to split traffic by percentage
Using two Services and an Ingress or service mesh allows weighted traffic splitting (e.g., 10% to canary, 90% to stable).
Step 3: Evaluate options
Create two Services, one for stable and one for canary, and use an Ingress with traffic splitting describes creating two Services and using Ingress for traffic splitting, which is the correct approach.
Final Answer:
Create two Services, one for stable and one for canary, and use an Ingress with traffic splitting -> Option B
Quick Check:
Weighted traffic split requires Ingress or service mesh [OK]
Hint: Use Ingress or service mesh for weighted traffic split [OK]