Gnoseed
DevOps · Flashcard

A developer creates a Service targeting Pods with label 'app: backend', but the Service returns no endpoints. Running 'kubectl get endpoints my-service' shows an empty list. The Pods are running and healthy. What is the most likely cause?

Why this is the answer

The most common cause of empty endpoints is a label selector mismatch. The Service's spec.selector must exactly match the labels on the target Pods. Even a subtle difference (dash vs underscore, different capitalization) causes a complete mismatch. Debug with 'kubectl get pods --show-labels' and compare against 'kubectl get svc -o yaml'. Services do require Pods to be Ready, but this wouldn't result in zero endpoints unless all Pods are unready.

Read more in the docs
Study in Gnoseed →