Debugging Cluster Networking & DNS Issues
Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures.
In plain words
Cluster networking diagnosis is following a letter from address generation through streets, routing desks, and the directory before blaming the recipient. The simple Kubernetes rule is: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
Think of it like…
Cluster networking diagnosis is following a letter from address generation through streets, routing desks, and the directory before blaming the recipient.
Where you’ve seen it
During a connectivity incident, the network owner runs kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot. Expected evidence: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence. If the run instead shows this symptom, stop and restore the last known state: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
Words you’ll hear
- DNS Debug
- For this lesson, DNS Debug is the controlling idea: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- CNI Debug
- CNI Debug is the checkpoint; run
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshootand inspect the owner chain. If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer. - Connectivity
- Connectivity is the outcome to preserve; the cost is explicit: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
- Verification evidence
- The evidence command is
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot. It connects the declaration to this behavior: Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures.
Visual diagram
Theory & deep dive
How DNS Debug reaches the intended state
Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures. Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
The concrete checkpoint is kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot; compare the DNS Debug owner, CNI Debug state, and Connectivity outcome instead of treating YAML acceptance as proof.
Run kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot after the change and correlate the result with Events and the owning object. Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
CNI Debug: failure boundary and production cost
If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer. The prerequisite contract is concrete: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control. A safe design limits blast radius, records the last good configuration, and uses kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot as a deterministic rollback checkpoint.
Capture the current state with kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
How it works, step by step
Step 1 of 41. Define the reachability contract
Declare selectors, listeners, routes, or policy and keep endpoint readiness explicit: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Goal
- Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures.
- Owner
- DNS Debug
When to use it & trade-offs
What it is
Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures. Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
Why it matters: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer. The invariant at risk is specific: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence. The quickest fact check before changing the design is kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot.
When to reach for it
- Use DNS Debug to enforce this invariant: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Use CNI Debug evidence from
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshootin reviews and incident timelines. Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures. - Choose the managed ingress or mesh route only when this cost is justified by governance or scale: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
When to avoid or be careful
- Avoid assuming DNS Debug is complete after YAML submission; the required behavior is concrete: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshootfirst: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer. - Avoid adopting a heavier platform wrapper before measuring its cost: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
Native, manual, and managed paths for DNS Debug
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot.Strengths: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
Watch out: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control. Recovery must also recognize this signal: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot; the expected invariant is: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.Strengths: kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike DNS Debug, it does not make this symptom self-documenting: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
Watch out: The added platform ownership buys value at this cost: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Trace DNS Debug to Connectivity through CNI Debug; the invariant is: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Recognize the symptom: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
- Justify the cost: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
- Verify with kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot instead of only inspecting YAML.
Benchmarks & rules of thumb
- 4
- layers to isolate: Pod, Service, DNS, and external path
- 53
- CoreDNS port
- 3
- probe targets: direct Pod IP, Service IP, and fully qualified name
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the DNS Debug owner contract: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence.
- Ignoring this telltale condition leads to unrelated changes: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer.
- Repeating
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshootwithout an owner for remediation wastes retry cost. Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence?
- Which owner object, logs, and Events would you inspect for this symptom-If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer-?
- At what threshold would this cost become unacceptable: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control?
kubectl get pods,svc,endpointslice -A; kubectl debug node/worker-1 -it --image=nicolaka/netshoot, name the failure, then justify the cost. Invariant: Network debugging progresses from API objects to endpoint readiness, same-node/direct Pod connectivity, Service virtual IP, DNS, and provider or host firewall evidence. Failure: If Pod-to-Pod works but Service fails, the fault narrows toward kube-proxy, eBPF, conntrack, or policy; if names fail but IP works, DNS is the next layer. Cost: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Debugging Cluster Networking & DNS Issues with generative AI interview Q&A and hands-on practice.