How the CNI Works

Learn how the CNI works in Kubernetes.

Overview

The CNI defines a container networking framework that allows the dynamic configuring of the network through a group of specifications and libraries.

How the CNI fits in

The Kubernetes networking model is implemented by the container runtime on each node, instead of kubelet. Just as the graph below shows, the container runtime (e.g. containerd) calls the executable CNI plugin to configure the network and add or remove a network interface to or from the container’s networking namespace (netns). As we mentioned previously, every Pod gets its own unique IP address, and it is the CNI plugin that has the responsibility to allocate the IP address and assign it to a Pod.

Get hands-on with 1200+ tech skills courses.