What Is CNI? Kubernetes Pod Networking and How to Triage Failures
The Container Network Interface (CNI) is a contract that defines how a container runtime invokes network plugins. CNI is not a single networking product or the one component that implements all Kubernetes networking. In Kubernetes, CNI-based plugins usually create and clean up network attachments for Pod sandboxes; Service routing and NetworkPolicy enforcement may belong to separate data planes or plugin features. This article explains the flow and a safe diagnostic order for a typical Linux Kubernetes node, based on official documentation checked on 23 November 2026.
What does CNI standardize?
CNI specifies the contract between a runtime and a plugin. An administrator provides JSON configuration such as a network name, plugin type, and IPAM settings. The runtime invokes the plugin executable with defined input and environment variables, and the plugin returns a result. The specification defines this interface and procedure, not whether a particular network uses a bridge, routes, virtual Ethernet pairs, or an overlay. Those choices depend on the plugin and cluster configuration. The current CNI specification document reports version 1.1.0, but configuration files and individual plugins can support different versions. Check their supported-version intersection instead of assuming the numbers are identical. The CNI specification treats runtime, plugin, and configuration version support separately.
How does a Pod attach to a network?
When Kubernetes creates a Pod, the container runtime prepares its isolated network namespace and invokes plugins according to the CNI configuration. The first plugin in a chain commonly sets up an interface and connectivity; it may delegate IP assignment to an IPAM plugin. IP Address Management (IPAM) allocates and releases addresses from a pool. Later chained plugins receive the previous result and can add functions such as port mapping or other network adjustments.
| Operation | Meaning | Typical role |
|---|---|---|
ADD | Add or configure a network attachment | Set up interface, address, routes; pass results along the chain |
DEL | Remove the attachment and undo configuration | Clean up interfaces/state and release addresses |
CHECK | Check that an existing attachment is in the expected state | Validate addresses/routes or other tracked state when supported |
VERSION | Report supported specification versions | Check compatibility between configuration and executable |
The runtime stores a successful ADD result for later CHECK and DEL operations. A chain runs ADD in configured order and DEL in reverse order. Therefore, CNI failures can affect Pod startup as well as cleanup during termination or recreation. See the CNI execution procedure and Kubernetes network-plugin documentation.
How is CNI different from kube-proxy and NetworkPolicy?
The Kubernetes network model assigns each Pod a cluster-reachable IP and expects Pod-to-Pod connectivity. A CNI-based Pod network implements this with node interfaces, routes, tunnels, or another data plane. Routing traffic sent to a Kubernetes Service virtual IP to its backend Pods is usually handled by kube-proxy or a service proxy integrated into the network implementation. The NetworkPolicy API also does not enforce itself: the Pod network implementation must support the policy for it to take effect. The Kubernetes networking overview distinguishes these responsibilities.
Choose the first investigation based on the symptom. If Pod IP connectivity fails, inspect the Pod network, node-to-node routing, and policy. If Pod IP connectivity works but Service IP access fails, start with the service data plane or EndpointSlices. If only name resolution fails, diagnose DNS separately. A CNI-related log does not mean every Service or DNS failure is caused by the CNI plugin.
How should you diagnose a Pod networking failure?
The following is a read-first sequence, not a provider-specific command recipe. Network-plugin DaemonSet names, node log locations, and runtime configuration paths vary by product and installation.
Run `kubectl describe pod <pod> -n <namespace>` and inspect Events. Determine whether the symptom is `FailedCreatePodSandBox`, a missing plugin executable, invalid configuration, or IP allocation failure. If the Pod was never created, runtime and CNI-plugin logs on its node are more useful than application logs.
Compare other Pods on the same node with Pods on other nodes. If failures cluster on one node, check the CNI agent there, the configuration and binary paths read by the runtime, and version compatibility. Since Kubernetes 1.24, CNI plugin management is no longer in kubelet scope; consult runtime and network-provider documentation too.
For missing or conflicting addresses, check Pod CIDRs and IP-pool exhaustion or overlap. Confirm that the configuration's `cniVersion` is supported by the plugin. Raising the version number arbitrarily can create compatibility problems.
Test Pod IP, Service IP, and DNS separately. When Pod IP works but Service IP does not, investigate the service proxy or EndpointSlices. When IP connectivity works but name lookup fails, investigate DNS. If policy may be responsible, inspect applied NetworkPolicies and whether the chosen plugin implements them.
Once the cause is known, follow the provider's procedure and change nodes one at a time. Cordon and drain a node when required before updating its CNI configuration or binaries. Then verify Pod creation and deletion, cross-node Pod connectivity, and Service connectivity before moving to the next node. Avoid ad hoc edits to live configuration or restarting many nodes at once.
Kubernetes troubleshooting documentation identifies runtime/plugin compatibility and missing or mismatched cniVersion as possible causes. Its containerd 1.6.0–1.6.3 example is a historical issue specific to those versions, not a universal explanation. For current incidents, consult the CNI troubleshooting guide and the current documentation for your network provider.
What should you consider when selecting or changing CNI?
Start by listing required capabilities: basic Pod connectivity, NetworkPolicy, multiple interfaces, IPAM choices, IPv4/IPv6 dual stack, encryption, or observability. These needs affect candidate plugins and operational complexity. Then verify support for your Kubernetes and container-runtime combination, node operating system, kernel and cloud-network constraints, plus documented upgrade and rollback paths. “CNI compatible” means support for the invocation contract; it does not guarantee that every networking feature is implemented the same way.
CNI is the standard contract for a runtime to call network plugins and manage their results. Kubernetes networking combines several responsibilities, including Pod networking, Service routing, policy, and DNS. Separating these layers helps narrow down which logs and configuration to inspect first.
Sources
[Container Network Interface specification](https://github.com/containernetworking/cni/blob/main/SPEC.md)
[Kubernetes network plugins](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
[Kubernetes Services, Load Balancing, and Networking](https://kubernetes.io/docs/concepts/services-networking/)
[Kubernetes cluster networking](https://kubernetes.io/docs/concepts/cluster-administration/networking/)
[Troubleshooting CNI plugin-related errors](https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/troubleshooting-cni-plugin-related-errors/)