CNI overview
Before diving into a CNI overview, let’s understand how networking is handled within a Kubernetes cluster.
When Kubernetes schedules a Pod to execute on a node, the node’s Linux kernel generates a network namespace for the Pod. This network namespace establishes a virtual network interface (VIF) between the node’s physical network interface—such as eth0
—and the Pod, allowing packets to flow to and from the Pod. The related VIF in the root network namespace of the node connects to a Linux bridge, allowing communication between Pods on the same node. A Pod can also use the same VIF to send packets outside of the node.
From a range of addresses reserved for Pods on the node, Kubernetes assigns an IP address (Pod IP address) to the VIF in the Pod’s network namespace. This address range is a subset of the cluster’s IP address range for Pods, which you can specify when you build a cluster.
The network namespace used...