Interview Prep/Kubernetes/Services, Ingress and DNS

Traffic to a Service works from some pods but times out from others. How do you debug it?

AdvancedScenarioServices, Ingress and DNS
Answer

Situation read → Only pods on certain nodes fail to reach the ClusterIP.

What I'd do →

  1. Run kubectl run tmp --rm -it --image=nicolaka/netshoot -- bash on the failing node using nodeName
  2. curl -v <clusterIP>:<port> and curl <podIP>:<targetPort> to separate Service from pod networking
  3. Check kube-proxy on that node with kubectl -n kube-system logs ds/kube-proxy
  4. On the node inspect iptables-save | grep <svc> or ipvsadm -Ln
  5. Check the CNI pod health and node security groups or firewall

Why → If pod IP works but ClusterIP does not, the issue is kube-proxy rules. If pod IP fails too, it is the CNI or network policy.

Interview tip → Separate the layers: pod to pod, pod to Service, external to Service.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, Ingress and DNS