The pods are Running, and the Service returns 503. Where is the break?
The scenario
Every pod is Running. The Service URL returns 503. Endpoints for the Service are empty. The pod labels and the Service selector differ by one word.
Model answer
What I'd say first:
I would not restart the pods. Running means the process is up. An empty endpoints list means the Service has nobody to send to, and I would check the selector.
How I'd work it:
- 1I list endpoints for the Service. Empty is the finding.
- 2I compare pod labels with the selector, including a typo or a missing label.
- 3I fix the selector or the label. I do not change the container command to chase a 503.
- 4I tell the room the pods were fine and the Service was not attached to them.
How I'd explain it:
A Service only sends to pods that match. If none match, you get 503 and a set of healthy-looking pods. A wrong answer is to look at application logs that never received a request.
How I'd prevent it:
A deploy check should fail when a Service has zero endpoints and the deployment is scaled above zero. Keep labels in one helper so the Service and the pod cannot drift. Alert on empty endpoints.
The follow-up they'll ask
“Restart the deployment so the pods pick up the Service?”
No. The pods do not pick up the Service. The selector picks up the pods. A restart keeps the same labels. I fix the mismatch. That shortcut is how this comes back on the next shift.
Common mistakes
- Restarting Running pods
- Debugging logs that saw no traffic
- Watching pod count instead of endpoints