Courseiva
Container OrchestrationmediumMultiple ChoiceObjective-mapped

KCNA Container Orchestration Practice Question

A team deploys a microservice that requires sticky sessions. The service runs on Kubernetes with multiple replicas. Which Kubernetes resource should be used to ensure requests from a client are consistently routed to the same pod?

⚠ Common exam trap

CNCF often tests the misconception that Ingress or Headless Services can handle session affinity by default, but only a Service with `sessionAffinity: ClientIP` provides this at the Kubernetes networking layer without additional configuration.

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

Service with sessionAffinity: ClientIP

Setting `sessionAffinity: ClientIP` on a Kubernetes Service ensures that all requests from the same client IP are routed to the same Pod. This is the standard Kubernetes mechanism for implementing sticky sessions without requiring changes to the application or ingress layer.

Answer analysis

Option-by-option breakdown

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

  • Headless Service

    Why it's wrong here

    Headless services are for pod discovery, not load balancing with stickiness.

  • Service with sessionAffinity: ClientIP

    Why this is correct

    This configuration ensures requests from the same client IP go to the same pod.

  • Ingress with default settings

    Why it's wrong here

    Ingress without session affinity annotation does not maintain stickiness.

  • Deployment with hostNetwork: true

    Why it's wrong here

    hostNetwork does not provide session affinity.

Go deeper

Related to this question

About these practice questions

One of 833 original KCNA 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

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This KCNA 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 KCNA exam.