How does networking work in Kubernetes: pod-to-pod, Services, and Ingress?
What they are really testing: Whether you understand the flat pod network, the role of the CNI and kube-proxy, cluster DNS, and where Ingress fits. This underpins most connectivity debugging.
A real interview question
How does networking work in Kubernetes: pod-to-pod, Services, and Ingress?
What most people say
drag me
“Pods talk to each other over the network and Services route traffic to them.”
It states the outcome but none of the mechanism: the flat pod network, the CNI, kube-proxy, cluster DNS, or NetworkPolicies. That mechanism is what you need when connectivity breaks.
The follow-ups they ask next
A Service exists but requests to it fail. What do you check?
Whether the Service has endpoints (kubectl get endpoints), which depends on the selector matching ready pods; DNS resolution of the service name; and whether a NetworkPolicy is blocking. No endpoints usually means a label-selector mismatch or no ready pods.
What is the default network policy behavior in Kubernetes?
Allow-all: with no NetworkPolicy, every pod can reach every other pod. You add a default-deny policy and then explicitly allow required flows to get real segmentation.
What the interviewer is listening for
- Knows flat pod network + CNI
- Explains Service/kube-proxy + CoreDNS
- Knows default allow-all and NetworkPolicies; Ingress for L7
What sinks the answer
- Only "pods talk over the network"
- No notion of CNI/kube-proxy/DNS
- Thinks traffic is denied by default
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“Every pod [gets its own IP and reaches any pod with no NAT, implemented by a CNI]. A Service [gives a stable virtual IP, kube-proxy routes it to ready pods]. [CoreDNS resolves service names]. [An Ingress controller does L7 routing/TLS at the edge]. [NetworkPolicies segment traffic, default is allow-all until you add deny]. Debug by [walking DNS, endpoints, readiness, policies].”
Keep going with kubernetes
Foundation
What problem does Kubernetes solve, and what does it actually do for you?
Foundation
What are the main components of a Kubernetes cluster (control plane and nodes)?
Foundation
What is a Pod, and why do you use a Deployment instead of creating Pods directly?
Foundation
What is a Service in Kubernetes, and what are the main types?
Junior
When would you use a Deployment versus a StatefulSet versus a DaemonSet?
Junior
How do you inject configuration and secrets into a pod, and what is the catch with Kubernetes Secrets?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free