KCNA Cloud Native Architecture Practice Question
A team is migrating a legacy application to Kubernetes. The application requires persistent storage and needs to maintain session affinity. Which set of Kubernetes resources should they use?
⚠ Common exam trap
CNCF often tests the misconception that a Deployment with a standard Service is sufficient for stateful workloads, ignoring that StatefulSet is required for stable storage and identity, and that session affinity must be explicitly configured on the Service, not assumed from Ingress or LoadBalancer alone.
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
✓
StatefulSet with a headless Service and Service with session affinity.
StatefulSet is the correct choice because it provides stable, unique network identities and persistent storage per pod, which are essential for stateful applications. A headless Service allows direct pod-to-pod communication without load balancing, while a regular Service with session affinity (using `externalTrafficPolicy: Local` or `sessionAffinity: ClientIP`) ensures client requests stick to the same pod, maintaining session state.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Deployment with a ClusterIP Service and Ingress.
Why it's wrong here
Deployment pods are ephemeral and don't have stable identities; session affinity may not work reliably.
- ✗
Job with a LoadBalancer Service.
Why it's wrong here
Job is for batch tasks, not long-running stateful applications.
- ✗
DaemonSet with a NodePort Service.
Why it's wrong here
DaemonSet runs one pod per node, not suitable for stateful applications requiring persistent storage per pod.
- ✓
StatefulSet with a headless Service and Service with session affinity.
Why this is correct
StatefulSet gives stable identities and persistent storage; session affinity ensures stickiness.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 833-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 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.