Use it when pods are stuck in ContainerCreating with network errors or pods on different nodes cannot talk.
Container Network Interface (CNI)
CNI (Container Network Interface) plugins (Calico, Cilium, Flannel, cloud CNIs) give pods their network interfaces and IPs and implement routing and often NetworkPolicy.
kubelet → CNI plugin → veth + IP + routes → cross-node via overlay/routing
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 How to verify Verify boundary
docker ps -a— containers and exit codesdocker logs <c>— container outputdocker inspect <c>— config, mounts, network, state
ReferenceWhat it is1 section · depth on demand
ReferenceImportant terms & boundaries3 sections · depth on demand
Common CNI plugins
| Plugin | Notes |
|---|---|
| Calico | Routing (BGP) or overlay, strong NetworkPolicy support |
| Cilium | eBPF datapath, NetworkPolicy, observability (Hubble), kube-proxy replacement |
| Flannel | Simple overlay, no NetworkPolicy by itself |
| AWS VPC CNI / Azure CNI | Pods get VPC/VNet IPs |
Config: /etc/cni/net.d/, binaries in /opt/cni/bin/. Pods stuck in ContainerCreating with network errors usually mean the CNI is not installed or crashing.
In depth
The Container Network Interface is a small contract: the runtime executes a plugin binary with a JSON network configuration and environment variables (CNI_COMMAND=ADD|DEL|CHECK, CNI_NETNS, CNI_IFNAME), and the plugin returns the interfaces and IPs it created.
Where the pieces live on a node
| Path | Content |
|---|---|
/etc/cni/net.d/ | Network configuration; the first file in lexical order is used |
/opt/cni/bin/ | Plugin binaries (bridge, host-local, portmap, vendor plugins) |
| CNI agent DaemonSet | Calico, Cilium, Flannel … programs routes, tunnels or eBPF |
Datapath models
| Model | How Pods on different nodes talk | Watch out for |
|---|---|---|
| Overlay (VXLAN, Geneve) | Encapsulated over the node network | 50-byte overhead → lower Pod MTU |
| Native routing (BGP, cloud routes) | Pod CIDRs routed by the network | Routes must exist in the underlay or cloud |
| eBPF | Programs attached to interfaces replace iptables | Kernel version requirements |
Worked check — cross-node Pod traffic fails
kubectl get pods -o wide # note Pod IPs and nodes
kubectl exec a -- ping -c2 <podB-ip> # small packets
kubectl exec a -- ping -c2 -M do -s 1400 <podB-ip> # large, no fragmentation
kubectl -n kube-system logs ds/<cni-agent> --tail=50
Small pings working while large ones fail is the classic MTU mismatch. No reply at all usually means the overlay port (UDP 4789 for VXLAN, 8472 for Flannel's VXLAN, TCP 179 for BGP) is blocked between nodes.
Common mistakes
- Two CNIs configured on one cluster.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.