Interview Prep/Kubernetes/Services, DNS, Ingress and NetworkPolicy

ingress-nginx returns `503 Service Temporarily Unavailable` and the controller log says `Service "shop/web" does not have any active Endpoint`.

BeginnerTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer

Likely causes → The backend Service has no ready Pods: all replicas failing readiness, scaled to zero, selector mismatch, or the Ingress points at the wrong Service name or port.

Diagnose →

kubectl get ingress -n shop -o jsonpath='{.items[*].spec.rules[*].http.paths[*].backend.service}'
kubectl get endpointslices -n shop -l kubernetes.io/service-name=web
kubectl get pods -n shop -l app=web

Fix → Fix the backend Pods or the Service reference; 503s stop as soon as endpoints are ready.

Prevent → minReplicas >= 2, PDBs, and alert on Ingress backends with zero endpoints.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, DNS, Ingress and NetworkPolicy