CKAD Application Deployment Practice Question
You are performing a canary deployment using two Deployments: 'app-stable' (replicas: 9) and 'app-canary' (replicas: 1), both with label 'app: myapp'. A Service selects pods with 'app: myapp' and 'version: stable'. How can you route traffic to the canary?
⚠ Common exam trap
Many candidates think they must change the Service's selector to include the canary, but the correct approach is to make the canary pods match the existing selector by adding the required labels, keeping the Service unchanged.
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 label 'version: stable' to the canary Deployment's pod template, so both Deployments have the same label, and keep the Service selector as is.
Adding the label 'version: stable' to the canary Deployment's pod template makes its pods match the Service's selector ('app: myapp' and 'version: stable'). This allows the Service to include both stable and canary pods, distributing traffic according to the replica ratio (9:1). The canary image can be different from stable, but the label ensures the Service routes traffic to both sets of pods.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Update the canary Deployment's image to a different version.
Why it's wrong here
Updating the canary Deployment's image only modifies the container image used by its pods; it does not change the pod labels. Kubernetes Service selectors match pods based on labels, not image versions or other pod spec fields. Until the canary pods are assigned labels that match the Service selector, they will not be included in the Service's endpoints, so no traffic will be directed to them. Thus, this action alone does not route any traffic to the canary.
- ✗
Change the Service's selector to 'version: canary'.
Why it's wrong here
Changing the Service selector to 'version: canary' would make the Service match only the canary pods (assuming they carry that label), causing all incoming traffic to be sent exclusively to the canary version. This eliminates any gradual traffic split and effectively performs a full cutover, not a canary. In a canary deployment, you want only a small percentage of traffic to flow to the new version initially, so this selector change defeats the purpose and risks exposing the entire user base to an unvalidated release.
- ✓
Add label 'version: stable' to the canary Deployment's pod template, so both Deployments have the same label, and keep the Service selector as is.
Why this is correct
Adding the label 'version: stable' to the canary Deployment's pod template ensures that its pods are selected by the existing Service selector (which is already set to 'version: stable'). The Service then load-balances across all matching pods from both Deployments, distributing traffic proportionally to their replica counts. For example, with 9 stable and 1 canary pod, the canary receives about 10% of traffic, enabling controlled rollout while both versions share the same label and the Service selector remains unchanged.
- ✗
Add label 'version: canary' to the canary Deployment's template and update the Service selector to 'version: stable || version: canary'.
Why it's wrong here
The selector 'version: stable || version: canary' is not a valid Kubernetes selector. Kubernetes supports equality-based selectors (e.g., version=stable) and set-based selectors (e.g., version in (stable, canary)), but it does not support OR logic in the form of '||'. Even if you corrected it to a valid set-based selector, this approach introduces an unnecessary separate label for the canary and complicates cleanup, whereas the standard pattern is to reuse the same label on both Deployments and rely on replica ratios for traffic splitting.
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 160-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.