CKAD Services and Networking Practice Question
A Service named `api` in namespace `default` has multiple endpoints. You run `kubectl get endpoints api` and see no IPs. What is the most likely cause?
⚠ Common exam trap
It's easy for candidates to confuse a headless Service (clusterIP: None) with a Service that has no endpoints, but a headless Service still has endpoints if its selector matches pods.
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
✓
The Service selector does not match any pods
The most likely cause is that the Service's selector does not match any pods. A Service uses its label selector to identify pods and automatically populate its endpoints. If no pods match the selector, the endpoints list will be empty, resulting in no IPs shown by `kubectl get endpoints api`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The Service type is ExternalName
Why it's wrong here
A Service of type ExternalName intentionally has no label selector because it is a CNAME alias to an external DNS name, not a load balancer in front of pods. The endpoints controller only generates Endpoints objects for Services that select pods; since ExternalName Services lack a selector, no Endpoints resource is ever created. This absence is by design, so the missing endpoints reflect the Service type itself, not a configuration error.
- ✗
The namespace has a NetworkPolicy blocking traffic
Why it's wrong here
NetworkPolicy resources are evaluated by the kube-proxy or CNI plugin to enforce allowed traffic flows, but they are completely separate from the endpoints controller in kube-controller-manager. Endpoints objects are populated based solely on a Service's selector matching pod labels, with no regard for network policy rules. Even if a NetworkPolicy drops all traffic to the pods, the Service would still have Endpoints if its selector matched; therefore a NetworkPolicy cannot be the reason the Endpoints object is missing.
- ✗
The Service has a clusterIP of None
Why it's wrong here
Setting clusterIP: None creates a headless Service, which removes the virtual IP and disables kube-proxy load balancing, but it does not alter endpoint generation. A headless Service still has a selector, and the endpoints controller will populate the Endpoints object with matched pod IPs so that DNS can return individual A records. Consequently, a headless Service with no Endpoints must have a selector mismatch or zero matching pods—not simply because it is headless.
- ✓
The Service selector does not match any pods
Why this is correct
The endpoints controller watches Services and Pods in the same namespace and creates an Endpoints object only when the Service's selector matches at least one ready pod. If no pod carries all of the label keys and values specified in the Service's selector, the controller will not create an Endpoints object; this is the most common cause of a Service with no endpoints. You can verify this by running kubectl describe service api to see the selector and then checking whether any pods in the namespace have those exact labels.
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.