Service Networking Errors — DNS, Timeouts, Port Mismatch and Mesh Sidecars

Healthy pods that cannot talk: dropped versus refused packets, DNS failures and five-second delays, port mismatches, rollout errors and mesh denials, with the commands and the EKS, AKS and GKE view.

Overview

At this layer every pod says Running and Ready, and requests between them still fail. Service networking is really three separate systems stacked on top of each other, and each fails on its own: name resolution (the pod's resolver and CoreDNS), connectivity (the CNI plugin, NetworkPolicy, node firewalls and any mesh sidecar) and port mapping (the Service, its EndpointSlices and whatever programs the Service virtual IP: kube-proxy in iptables, IPVS or nftables mode, or an eBPF data plane such as Cilium).

Work outside-in and test the layers in order: resolve the name, then open a socket to the pod IP, then open a socket to the Service. Each step either passes or tells you exactly which system to fix. The error text helps too. A refusal means the packet arrived and nothing was listening. A timeout means the packet vanished, which almost always means something filtered it.

The one idea to keep: a healthy pod proves nothing about the path to it. Test from where the traffic really starts, ideally from inside the calling pod's own network namespace with kubectl debug, because NetworkPolicy, DNS settings and sidecars all depend on which pod is asking.

The path a request takes

A call from orders to payments crosses every one of those systems in turn, and traffic from outside the cluster joins the same path through a cloud load balancer.

Key concepts

  • Timeout versus refusal
  • NetworkPolicy isolation
  • ndots:5 and the search list
  • NodeLocal DNSCache
  • port, targetPort, containerPort
  • EndpointSlice conditions
  • Service proxy modes
  • Native sidecar
  • externalTrafficPolicy

Interview questions

  • The orders service in prod times out calling payments in the payments namespace. DNS resolves. Walk me through it.
  • Some outbound API calls from our pods take just over 5 seconds, most take milliseconds. What is going on?
  • After every deploy we see 20 seconds of 502s from the ingress, even though readiness probes are correct. Explain and fix.
  • curl to orders-svc gives connection refused, but curl localhost:8080 inside the pod works. What do you check?
  • We enabled Istio STRICT mTLS in payments and some callers started getting connection resets while others get 403. Why the difference?
  • How would the same DNS failure look different on EKS, AKS and GKE, and where would you look on each?
  • A LoadBalancer Service with externalTrafficPolicy: Local shows 7 of 9 nodes unhealthy. Is that a problem?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio