Courseiva
Application Deployment →hardMultiple Choice

CKAD Practice Question: During a canary deployment, you want to send 10% of traffic to the new version

During a canary deployment, you want to send 10% of traffic to the new version. You have two Deployments: 'app-stable' (version: stable) and 'app-canary' (version: canary). You use a Service with label selector 'app: myapp' and a second selector for version. How can you achieve the 10% traffic split?

⚠ Common exam trap

A common pitfall is the misconception that scaling replicas in proportion to desired traffic split (e.g., 1 canary and 9 stable) will automatically give a 10% traffic split via a single Service. However, Kubernetes Service load balancing is not weighted by replica count and does not guarantee precise percentages.

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

✓

Use an Ingress controller that supports canary deployments or a service mesh

Kubernetes Services alone cannot perform weighted traffic splitting based on replica counts; they use round-robin load balancing at the pod level. To achieve a precise 10% traffic split, you need an Ingress controller (e.g., NGINX Ingress with canary annotations) or a service mesh (e.g., Istio with VirtualService) that supports weighted routing between two different Services or subsets. This allows you to direct a specific percentage of traffic to the canary version independently of replica counts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Use an Ingress controller that supports canary deployments or a service mesh

    Why this is correct

    Ingress controllers such as NGINX Ingress expose canary-specific annotations (e.g., nginx.ingress.kubernetes.io/canary-weight) that allow precise, percentage-based traffic splitting between two backend Services, while a service mesh like Istio provides similar fine-grained control through VirtualService and DestinationRule resources. This approach operates at the L7 routing layer, so it can deterministically send exactly 10% of requests to the canary version instead of relying on heuristics like replica counts or connection persistence.

  • ✗

    Use a Service with multiple ports

    Why it's wrong here

    A Service with multiple ports is designed to expose different application ports (e.g., 80 for HTTP and 443 for HTTPS) or distinct protocols to the same set of Pods. It has no concept of routing some proportion of traffic to one backend and the rest to another; all ports are simply made available and load-balanced equally across the selected Pods. Therefore, it cannot split traffic between a stable and a canary version, because every port either reaches the same set of Pods or requires separate Services entirely.

  • ✗

    Set the Service's sessionAffinity to distribute load

    Why it's wrong here

    Setting sessionAffinity (e.g., ClientIP) on a Service only ensures that requests from a given client IP are consistently routed to the same backend Pod once a connection is established. It does not assign weights or percentages to different backend Pods, and it does not inherently distribute a fixed share of traffic to a canary cohort. In fact, using session affinity could make a canary release less predictable because a small number of clients might monopolize the canary backend or be excluded from it, depending on the affinity rule and client distribution.

  • ✗

    Scale app-canary to 1 replica and app-stable to 9 replicas, and use a single Service that selects both

    Why it's wrong here

    Scaling to 1 canary and 9 stable replicas may statistically approximate 10% of TCP/HTTP connections, but it is not a true canary deployment technique because Kubernetes Service load balancing is per-connection and does not guarantee a precise request percentage—especially with keep-alive or HTTP/2 where one pod can handle many requests. Adjusting the traffic ratio then requires manually rescaling replicas, and it fails entirely for canary strategies that depend on header, cookie, or path-based routing. More importantly, the question expects a method that uses canary-aware routing, not a crude workaround that conflates replica count with traffic weight.

About these practice questions

One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

You might also like

Similar CKAD questions

Written by Johnson Ajibi, MSc IT Security

Security Systems Architect · 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.