CKAD Services and Networking Practice Question
A StatefulSet named 'web' is created with 3 replicas. What is the DNS name for the second pod (index 1)?
⚠ Common exam trap
The trap here is that candidates often forget the Service name must appear between the pod name and namespace, or they confuse the ordinal index (starting at 0) with the replica count, leading them to pick `web-2` for the second pod.
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
✓
web-1.web.default.svc.cluster.local
In Kubernetes, a StatefulSet creates pods with a stable, ordinal hostname based on the pattern `<statefulset-name>-<ordinal>`. The second pod (index 1) is named `web-1`. When a headless Service (named `web`) is associated with the StatefulSet, each pod gets a DNS A record in the form `<pod-name>.<service-name>.<namespace>.svc.cluster.local`. Therefore, the correct DNS name is `web-1.web.default.svc.cluster.local`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
web-1.web.default.svc.cluster.local
Why this is correct
web-1.web.default.svc.cluster.local is correct because StatefulSet pods follow the stable DNS naming pattern <pod-name>.<governing-service>.<namespace>.svc.cluster.local. The pod is named web-1 and the governing service is web, so combining the two yields this exact FQDN. This allows clients to target a specific replica's stable network identity.
- ✗
web-2.web.default.svc.cluster.local
Why it's wrong here
web-2.web.default.svc.cluster.local points to the third replica, not the second. StatefulSet ordinals are zero-based, so with 3 replicas the pod names are web-0, web-1, and web-2; the second pod (the one in question) is web-1, not web-2. This distinction matters because in Kubernetes, StatefulSet pods are never named with a 1-based index.
- ✗
web.default.svc.cluster.local
Why it's wrong here
web.default.svc.cluster.local is the DNS name of the Service, not of any individual pod. For a headless Service, this name resolves to the set of all backing pod IPs, and for a normal ClusterIP Service it resolves to the Service ClusterIP, which load-balances. It cannot identify a single replica, so it is incorrect when the question asks for a specific pod's DNS.
- ✗
web-1.default.svc.cluster.local
Why it's wrong here
web-1.default.svc.cluster.local omits the governing Service name, so it does not match the StatefulSet pod DNS convention of <pod-name>.<service-name>.<namespace>.svc.cluster.local. In this format, the second label must be the name of the Service that governs the StatefulSet (web), not just the namespace (default). Without that Service component, this FQDN is not a recognized StatefulSet pod identity.
Visual reference
Go deeper
Related to this question
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 →
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.