Courseiva
Services and NetworkinghardMultiple ChoiceObjective-mapped

CKAD Services and Networking Practice Question

A Service named 'api' has no endpoints. 'kubectl describe svc api' shows the selector 'app: api', but no pods have that label. What is the most likely reason for missing endpoints?

⚠ Common exam trap

Watch out — candidates often assume missing endpoints are due to namespace mismatch or port misconfiguration, but the core issue is always the selector-to-pod label match, which is the fundamental mechanism for endpoint discovery in Kubernetes Services.

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

No pods match the Service's selector

The most likely reason for missing endpoints is that no pods match the Service's selector. A Kubernetes Service routes traffic to pods that have labels matching its `spec.selector`. If `kubectl describe svc api` shows `Selector: app=api` but no pods carry the label `app: api`, the Service's endpoint controller will not populate any endpoints, resulting in an empty `Endpoints` object. This is the direct cause of the missing endpoints.

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 is in a different namespace than the pods

    Why it's wrong here

    Services and pods can be in different namespaces? Actually, the selector selects pods in the same namespace. But if pods are in a different namespace, they won't be selected. However, the question implies no pods with that label exist, so that's the issue.

  • No pods match the Service's selector

    Why this is correct

    The Service's endpoints are generated dynamically from the pods whose labels match its `selector` field. If no pods in the Service's namespace carry that label (e.g., `app: api`), no pod IPs are added to the Endpoints objects, so `kubectl describe svc` displays "Endpoints: <none>". This is the most frequent cause of an endpointless Service.

  • The Service port is incorrect

    Why it's wrong here

    The Service's `port` value determines which entry listening on the Service's cluster IP is forwarded to, but it has no influence on whether endpoints are created. Endpoint generation is controlled entirely by the label selector and pod readiness; even a completely wrong `targetPort` will still produce endpoint entries that point to the pods, just with forwarding that may fail. Therefore, an incorrect port cannot be the reason the Service reports no endpoints.

  • The Service type is ExternalName

    Why it's wrong here

    A Service of type `ExternalName` is a special case that does not use a selector at all; instead, it maps the Service name to a DNS CNAME. Because there is no selector, Kubernetes never attempts to build an Endpoints object for it, so the absence of endpoints would be expected and normal. However, the question describes a Service that is presumably meant to route to pods, and if it were `ExternalName`, the Service description would explicitly show `Type: ExternalName` rather than the typical selector-based configuration.

About these practice questions

This CKAD question is part of Courseiva's 160-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 →

How Courseiva writes practice questions · Editorial policy

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.