Pods cannot reach anything on the internet (`curl https://github.com` times out), while in-cluster traffic works.
IntermediateTroubleshootingServices, DNS, Ingress and NetworkPolicy
Answer
Likely causes → No egress path: private subnets with no NAT gateway or a broken route table, an egress NetworkPolicy, a corporate proxy required, or on EKS the VPC CNI's SNAT disabled (AWS_VPC_K8S_CNI_EXTERNALSNAT=true) without a NAT.
Diagnose →
kubectl run nettest --rm -it --image=nicolaka/netshoot --restart=Never -- bash -c 'nslookup github.com; curl -sv --max-time 5 https://github.com -o /dev/null'
kubectl debug node/<node> -it --image=nicolaka/netshoot -- curl -s --max-time 5 https://github.com -o /dev/null -w '%{http_code}\n'
aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=<subnet>
If the node works but the Pod does not, it is SNAT or NetworkPolicy; if both fail, it is routing/NAT.
Fix → Add the NAT route or fix SNAT settings; allow egress in NetworkPolicy; set HTTPS_PROXY/NO_PROXY (include .svc,.cluster.local,10.0.0.0/8) if a proxy is mandatory.
Prevent → VPC endpoints for AWS services, egress tests in cluster bootstrap.
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