CKAD Application Deployment Practice Question
You are using a canary deployment pattern with two Deployments: 'web-stable' (version 1) and 'web-canary' (version 2). Both have the label 'app: web'. The Service 'web-svc' selects pods with 'app: web' and 'version: stable'. How do you route traffic to the canary?
⚠ Common exam trap
Many candidates think they need to create a separate Service or use a special command for canary deployments, when in fact Kubernetes supports canary routing simply by updating the Service's selector to include both versions' labels, leveraging the built-in load balancing.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Add the label 'version: canary' to the canary Deployment's pod template and update the Service's selector to 'app: web, version in (stable, canary)'.
The Service 'web-svc' currently selects pods with 'app: web' and 'version: stable'. To route traffic to the canary pods (version 2), you need to add the label 'version: canary' to the canary Deployment's pod template so that those pods are created with that label. Then, updating the Service's selector to 'app: web, version in (stable, canary)' allows the Service to match both stable and canary pods, distributing traffic between them according to the Service's default round-robin behavior.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Add the label 'version: canary' to the canary Deployment's pod template and update the Service's selector to 'app: web, version in (stable, canary)'.
Why this is correct
Adding the 'version: canary' label to the canary pod template and updating the Service selector to a set-based requirement (version in (stable, canary)) allows the existing Service to include both stable and canary pods in its endpoints. Kubernetes Services load-balance across all ready endpoints, so traffic is distributed proportionally to the replica counts of each Deployment. You can then carefully scale the canary Deployment up to increase its traffic share, making this a native, controlled canary strategy.
- ✗
Use kubectl rollout canary on the stable Deployment.
Why it's wrong here
kubectl does not provide any 'rollout canary' subcommand; the rollout command only supports status, history, pause, resume, restart, and undo. Canary deployments are not a built-in kubectl feature and must be orchestrated manually with multiple Deployments or implemented via external progressive delivery tools like Argo Rollouts or Flagger. Running this command would simply fail with an unknown command error.
- ✗
Create a new Service with selector 'app: web, version: canary' and use an ingress to split traffic.
Why it's wrong here
Creating a supplementary Service for canary pods and using an Ingress to split traffic adds unnecessary complexity and depends on ingress-controller-specific canary annotations (e.g., nginx.ingress.kubernetes.io/canary-weight) rather than core Kubernetes behavior. The standard canary pattern with a single Service keeps routing logic in one place and works across any environment. Moreover, the question explicitly asks about routing with the existing Service, so introducing a separate Service and Ingress diverges from that constraint.
- ✗
Change the Service selector to 'app: web' only (remove version label).
Why it's wrong here
Setting the Service selector to only 'app: web' (omitting the version label) makes the Service treat all web pods as equal endpoints, so stable and canary instances share traffic directly in proportion to their replica counts. This gives no ability to control the canary's traffic share independently; any change in canary replicas immediately affects the entire traffic distribution, and removing the version label also makes it impossible to later target a specific version for debugging or rollback. Thus, it is an uncontrolled all-or-nothing approach rather than a canary rollout.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 160 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.