KCNA Kubernetes Fundamentals Practice Question
An application requires that a set of Pods each be assigned a unique DNS name that can be used for peer-to-peer communication. Which Kubernetes resource should be used?
⚠ Common exam trap
Candidates often assume any Service provides unique DNS names, but only a Headless Service combined with a StatefulSet yields per-Pod DNS entries; a regular Service (ClusterIP or NodePort) always load-balances to a single virtual IP.
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
A StatefulSet with a Headless Service is correct because StatefulSets assign each Pod a stable, unique network identity (e.g., pod-name-0.service-name.namespace.svc.cluster.local) that persists across rescheduling. A Headless Service (clusterIP: None) disables load balancing and DNS round-robin, allowing direct DNS resolution to individual Pod IPs for peer-to-peer communication. This matches the requirement for unique DNS names for each Pod.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Job with a Service
Why it's wrong here
A Job runs Pods to completion and exits, so no stable per-Pod identity persists for peer-to-peer traffic. It is tempting for batch workloads needing a Service, but stable unique DNS names per Pod require a headless Service governing a StatefulSet.
- ✗
DaemonSet with a Service
Why it's wrong here
A DaemonSet schedules one Pod per node for node-level functions, giving no stable per-Pod DNS identity for application peers. It is tempting for cluster-wide agents, but unique Pod DNS names require a StatefulSet paired with a headless Service.
- ✓
StatefulSet with a Headless Service
Why this is correct
A StatefulSet with a Headless Service satisfies the unique DNS requirement: each Pod receives a stable, ordinal hostname such as pod-0.service.namespace.svc.cluster.local, resolved directly to the Pod IP rather than a load-balanced ClusterIP. This stable per-Pod identity enables direct peer-to-peer communication, which a Deployment behind a normal Service cannot provide.
- ✗
Deployment with a Service
Why it's wrong here
A Deployment's Pods share one Service DNS name and receive random ordinal-less names, so individual Pods are not uniquely addressable. It is tempting for stateless replicated workloads, but per-Pod DNS identity requires a StatefulSet with a headless Service.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 930 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 →
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.