`kubectl port-forward svc/web 8080:80` fails with `error: unable to forward port because pod is not running. Current status=Pending`.
BeginnerTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer
Likely causes → port-forward to a Service actually picks one backing Pod; if the chosen Pod is not Running, it fails. It does not load balance and does not use the Service's endpoints readiness.
Diagnose →
kubectl get pods -l app=web
Fix → Fix the Pending Pod, or forward to a specific running Pod: kubectl port-forward pod/web-abc 8080:8080. Remember the right side is the Service port when targeting svc/, mapped to the targetPort.
Prevent → Use port-forward for debugging only, not as an access path.
More on Services, DNS, Ingress and NetworkPolicy
`curl http://orders.shop.svc.cluster.local` hangs, and `kubectl get endpointslices -l kubernetes.io/service-name=orders` shows `ENDPOINTS <unset>`.BeginnerEndpoints exist, but `curl orders:80` returns `Connection refused`.BeginnerA Service works when you curl the Pod IP but times out on the ClusterIP from every node.IntermediateInside a Pod, `nslookup orders` returns `;; connection timed out; no servers could be reached`.BeginnerCoreDNS Pods are in CrashLoopBackOff with `[FATAL] plugin/loop: Loop (127.0.0.1:41823 -> :53) detected for zone "."`.IntermediateCalls to `api.stripe.com` from Pods are slow, and CoreDNS logs show `api.stripe.com.payments.svc.cluster.local`, `api.stripe.com.svc.cluster.local` … all `NXDOMAIN`.Intermediate