Interview Prep/Networking/Kubernetes & Service Networking in Production

How do you debug "pod cannot reach service" in Kubernetes?

AdvancedProductionKubernetes & Service Networking in Production
Answer

Check in order: pod resolves the Service name, Service has endpoints (kubectl get endpointslices), selector labels match pod labels, targetPort is correct, readiness passes, NetworkPolicy permits the flow, kube-proxy or Cilium programmed rules, and the destination app listens on 0.0.0.0.

kubectl run net --rm -it --image=nicolaka/netshoot -- bash
nslookup web.shop; curl -sv web.shop:80
kubectl get endpoints web -n shop

Empty endpoints is the most common cause.

All Networking questions Roadmap: Networking for DevOps

More on Kubernetes & Service Networking in Production