CKAD Services and Networking Practice Question
A StatefulSet named 'mysql' is deployed with 3 replicas. The administrator wants each pod to have a stable network identity. Which service configuration is required?
⚠ Common exam trap
The CKAD exam often tests the misconception that any Kubernetes service type (like ClusterIP or NodePort) can provide stable network identities for StatefulSet pods, but only a headless service with `clusterIP: None` disables the virtual IP and enables per-pod DNS records.
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
✓
A headless service with clusterIP: None and selector matching the StatefulSet
A headless service with `clusterIP: None` is required for a StatefulSet to provide stable network identities. Each pod in a StatefulSet gets a unique, predictable DNS name (e.g., `mysql-0.mysql.default.svc.cluster.local`) that persists across rescheduling. This is achieved by setting the service's `clusterIP` to `None`, which disables load balancing and returns DNS A/AAAA records for individual pod IPs instead of a single service IP.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
A headless service with clusterIP: None and selector matching the StatefulSet
Why this is correct
A headless service with `clusterIP: None` and a selector that matches the StatefulSet is required because it publishes a DNS A record for each pod, such as `mysql-0.mysql.default.svc.cluster.local`. This gives every replica a stable, unique network identity that persists across pod reschedules, allowing clients to connect directly to a specific pod. In contrast, a normal service would collapse all pod IPs behind one virtual IP, which erases per-pod identity.
- ✗
A ClusterIP service named 'mysql'
Why it's wrong here
A ClusterIP service named 'mysql' assigns a single cluster-internal virtual IP address that load-balances TCP traffic across all three replicas. When clients resolve the service hostname, they receive that one IP, not individual pod DNS names, so requests are distributed evenly instead of targeting a specific replica. This is acceptable for stateless workloads but fails to meet the requirement of stable per-pod network identity that a StatefulSet needs.
- ✗
A NodePort service named 'mysql'
Why it's wrong here
A NodePort service named 'mysql' exposes the workload on a high port on every node, primarily for external access, but it still relies on a single service endpoint and does not create per-pod DNS records. Like a ClusterIP service, it abstracts away the individual pod addresses, so clients cannot directly address `mysql-0` or `mysql-1`. Therefore, it does not satisfy the need for stable network identifiers for stateful replicas.
- ✗
An ExternalName service pointing to an external database
Why it's wrong here
An ExternalName service pointing to an external database does not have any selectors and therefore does not route traffic to the StatefulSet pods at all. Instead, it acts as a CNAME alias, returning an external domain name as resolved DNS. Since the requirement is to give the three MySQL replicas stable internal network identities, this service type is completely irrelevant and would break all connectivity to the StatefulSet.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKAD question from scratch — 826 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 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.