debugMajorpending
Kubernetes service not routing traffic to pods
Viewed 0 times
service selectorendpoints emptylabel mismatchtargetPortreadiness probe
kubernetes
Error Messages
Problem
Kubernetes Service exists but requests timeout or return connection refused. Pods are running and healthy but the Service doesn't route traffic to them.
Solution
Almost always a label mismatch. (1) Check that Service selector matches Pod labels exactly: kubectl get svc -o yaml vs kubectl get pods --show-labels. (2) Verify endpoints exist: kubectl get endpoints <svc-name> — if empty, selector doesn't match. (3) Check targetPort matches the port your app actually listens on (not the container port). (4) Verify pod readiness probe passes — unready pods are excluded from endpoints. (5) Check NetworkPolicy isn't blocking traffic.
Why
Services use label selectors to find pods. If labels don't match exactly (case-sensitive), the Service has no endpoints and traffic goes nowhere.
Revisions (0)
No revisions yet.