Sub topic 12
Pod-to-Pod networking and the CNI plugin
This chapter assumes you know basic kubectl usage, Pods and namespaces, and basic TCP/IP (IP address, port, subnet). A Service sits on top of Pod networking. If Pods cannot reach each other by IP, no Service or DNS fix will help. This chapter explains the Pod network and how to test it directly.
The Kubernetes network model
Kubernetes expects three things from the cluster network:
- Every Pod gets its own IP address.
- Any Pod can reach any other Pod by that IP, without NAT, on any node.
- Agents on a node, such as the kubelet, can reach all Pods on that node.
Kubernetes does not implement this itself. A CNI plugin (Container Network Interface plugin) does. The container runtime calls the plugin when a Pod sandbox starts. The plugin creates a network interface in the Pod's network namespace, assigns an IP from the node's Pod CIDR range, and sets up routes. Common plugins include Calico, Cilium, Flannel, and the AWS VPC CNI.
Some plugins use an overlay (such as VXLAN) that wraps Pod traffic in node-to-node packets. Others use plain routing. The details differ, but the debugging approach is the same.
Symptoms of a Pod network problem
Suspect the Pod network when:
- Pods stay in
ContainerCreatingandkubectl describe podshows events such asfailed to set up sandbox containerornetwork plugin is not ready. - Pods on the same node talk to each other, but Pods on different nodes cannot.
- A Pod can reach its own IP but nothing else.
- Connecting to a Pod IP directly fails, while the same Pod works from its own node.
Nodes stuck in NotReady with a message about the CNI configuration not being initialized also point here.
Test Pod IPs directly
Test with Pod IPs, which removes Services and DNS from the picture. First list the Pods with their IPs and nodes:
kubectl get pods -o wideThen run a temporary Pod and connect to a backend Pod IP. Replace 10.244.2.9 with a real IP from the previous output.
kubectl run tmp-debug --rm -it --restart=Never --image=busybox:1.36 -- sh
# inside the Pod:
wget -qO- -T 3 http://10.244.2.9:80The result tells you where to look:
| Result | Likely meaning |
|---|---|
| Response received | Pod network works. Look at Services, endpoints, or DNS. |
| Timeout | Packets are dropped. Suspect the CNI, node firewall, or a NetworkPolicy. |
| Connection refused | The network works, but nothing listens on that port in the Pod. |
Repeat the test from Pods on different nodes. Use -o wide to see which node each Pod runs on. If only cross-node traffic times out, the problem is usually in the overlay or routing between nodes, such as a blocked VXLAN port or a missing route.
Check the CNI plugin itself
CNI plugins usually run as a DaemonSet, one Pod per node, in kube-system or their own namespace. Check that they are healthy and read their logs:
kubectl -n kube-system get pods -o wide
kubectl -n kube-system logs <cni-pod-name>A CNI Pod that is crashing on one node explains why only that node's Pods fail. Common causes are an exhausted Pod IP range on a node, a mismatch between the cluster's Pod CIDR and the plugin's configuration, and cloud firewall rules that block traffic between nodes.
Exercise
A client Pod can reach a backend Pod by IP when both run on node A, but the request times out when the backend runs on node B. Is this more likely a Service selector problem or a Pod network problem, and why?
Show answer
A Pod network problem. The request uses a Pod IP, so no Service or selector is involved. Success on one node and timeouts across nodes points to the CNI overlay or routing between nodes, or to a firewall blocking node-to-node traffic. A NetworkPolicy is also possible if it differs by node or Pod, but the node-dependent pattern favors the CNI or the underlying network.