No healthy pods are registered behind the service
Production Risk
All requests to the service fail with connection errors; the service is completely unavailable.
ServiceEndpointNotFound means a Kubernetes Service exists but has no endpoints — no pod IP addresses registered as healthy backends. Requests to the service will fail with connection refused or connection reset. This happens when no pods match the service selector, all matching pods are not Ready, or the target port does not match any container port.
- 1No pods exist with labels matching the service selector
- 2Matching pods exist but their readiness probes are failing (removed from endpoints)
- 3Service selector labels do not match the pod labels (typo or label mismatch)
- 4targetPort in the service does not match the containerPort in the pod spec
Service exists but requests fail; kubectl get endpoints shows no addresses.
kubectl get endpoints myservice # NAME ENDPOINTS AGE # myservice <none> 30m kubectl get pods -l app=myapp kubectl describe service myservice | grep -E "Selector|TargetPort"
expected output
NAME ENDPOINTS AGE myservice <none> 30m
Fix 1
Verify service selector matches pod labels
WHEN Endpoints list is empty despite pods running
# Get service selector
kubectl get service myservice -o jsonpath='{.spec.selector}'
# Output: {"app":"myapp"}
# Get pod labels
kubectl get pods -l app=myapp --show-labels
# If mismatch, fix the service selector or pod labels
kubectl label pod mypod app=myappWhy this works
The service selector must exactly match pod labels for the pod to be added to endpoints.
Fix 2
Check pod readiness status
WHEN Pods exist but endpoints list is still empty
kubectl get pods -l app=myapp # If READY shows 0/1, the readiness probe is failing kubectl describe pod mypod | grep -A 10 "Readiness:"
Why this works
Only Ready pods are added to service endpoints; failing readiness probes exclude pods from routing.
Kubernetes Documentation
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev