Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 59/ 160
03. Kubernetes Networking & Traffic Management

Debugging Cluster Networking & DNS Issues

Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures.

IntermediateDNS Debug · CNI Debug · Connectivity3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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/netshoot and 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

Loading interactive 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.

Verify CNI Debug, not only object creation

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.

Key takeaway: DNS Debug is implemented only when this invariant remains observable: 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.

Recover from CNI Debug drift

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.

Key takeaway: Accept the trade-off consciously: Layered evidence finds the failed boundary faster, but packet traces can expose sensitive traffic and require node privileges that production teams should tightly control.

How it works, step by step

Step 1 of 4
Traffic author

1. 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.

DNS Debug contract → owned state
Key numbers at this step
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/netshoot in 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/netshoot first: 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

Built-in API path
Best for: Systematically debug CNI, kube-proxy, CoreDNS, and connectivity failures. A concrete incident check is 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.

Datapath-specific extension
Best for: Quickly testing the CNI Debug assumption with 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.

Managed ingress or mesh
Best for: Teams that need Connectivity integrated with guardrails; the evidence path is 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/netshoot without 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?
Interview tip: Interview sequence: state the invariant, run 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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Dual-Stack IPv4/IPv6 Networking in Kubernetes
Next topic
Service Mesh Introduction (Istio & Linkerd: mTLS, Retries, Circuit Breaking)