All jobs / DevOps / SRE / cloud / Kubernetes
DevOps / SRE / cloud interview question · 3–5 years
The pods are Running, but calls to the Service get connection refused.
Walk me through the diagnosis.
The strongest answer
`kubectl get endpoints` for the Service — empty means the selector does not match the pod labels or the pods are not Ready; populated means check targetPort against the container port and the readiness probe
Why it works
Exactly — a Service routes to endpoints, and endpoints are pods matching the selector and passing readiness. Empty list, wrong labels or not ready.
What a good answer covers
- Service routes to endpoints.
- Check kubectl get endpoints.
- Selector, readiness, targetPort.
- Running is not Ready.
Answers that fall short
- Close, but not the strongest: Restart the pods; Running usually just needs a nudge
Running is not Ready and not selected; restarting changes neither the labels nor the selector. - Weak: Delete and recreate the Service with type LoadBalancer so it has an external IP
The type decides how the Service is reached, not whether it has any pods behind it. - Red flag: Port-forward straight to one pod and give that to the callers for now
Handing callers a port-forward turns a debug tool into production wiring.
Who gets asked this
More Kubernetes questions
- The cluster is two versions behind. How do you catch up?
- Pods cannot reach an external API that works from your laptop. What do you check in the cluster?
- HPA keeps adding pods; memory still climbs per pod. What is going on?
- A cluster has no NetworkPolicies. What do you install without boiling the ocean?
- You run one precious cluster that cannot be rebuilt. What is the programme?
- Thirty teams share a few clusters. Requests for cluster-admin “just to deploy” arrive weekly. How do you hand…
- A service’s health URL always returns 200 from the process start. What did you miss?
- A candidate says “Kubernetes is Docker for production.” What is the cleaner sentence?