Courseiva
Services and Networking →mediumMultiple Choice

CKA Services and Networking Practice Question

You run 'kubectl get svc my-service -o yaml' and see 'type: ClusterIP'. The service has no endpoints. What is the most likely cause?

⚠ Common exam trap

Candidates often assume a missing endpoint is due to a port mismatch or Service type limitation, rather than recognizing that endpoints are solely driven by the label selector and Pod readiness.

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 with labels matching the service selector are running and ready.

A Kubernetes Service of type ClusterIP relies on a label selector to identify target Pods. If no Pods match the selector and are in the Ready state, the Service will have no endpoints, causing traffic to be dropped. The absence of endpoints directly indicates a mismatch or absence of matching, ready Pods.

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 ClusterIP, which does not support endpoints.

    Why it's wrong here

    ClusterIP is the default Service type and it fully supports endpoints. Kubernetes automatically creates an Endpoints object (or EndpointSlices) for any ClusterIP Service that has a selector, using the IPs of matching pods. A missing endpoint list is never caused by the Service type itself; an Endpoints object may be empty because no pods match the selector, not because ClusterIP lacks endpoint capability.

  • ✗

    The service's port does not match the container port.

    Why it's wrong here

    A service port and container port mismatch prevents traffic from getting through, but it does not affect whether endpoints are created. When a Service has a selector, the endpoint controller writes each matching pod's IP and the targetPort (filling in the default if omitted) into the Endpoints object, regardless of the Service's own port number. If the port were the issue, you would still see endpoints listed but connectivity would fail; no endpoints at all points squarely to a selector or readiness problem.

  • ✗

    The service is misconfigured and needs to be deleted and recreated.

    Why it's wrong here

    Deleting and recreating a Service does not change the fact that endpoints are generated from pod label selectors, not from the Service object's existence. If no pods match the selector or the matching pods are not Ready, the new Service will also have an empty Endpoints list. This option incorrectly assumes a malformed spec is to blame when in practice the most common reason for missing endpoints is absent or unready pods, not a need for recreation.

  • ✓

    No pods with labels matching the service selector are running and ready.

    Why this is correct

    The endpoint controller only publishes Backends for pods that match the Service's selector and have their Ready condition set to True. If no pod carries the label/value pair defined in the selector, or if all matching pods are still Pending/Running with failing readiness probes, the Endpoints object stays empty. This is the canonical root cause of a Service with type ClusterIP but no endpoints.

Go deeper

Related to this question

About these practice questions

Courseiva writes every CKA question from scratch — 726 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKA 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 CKA exam.