Search⌘ K
AI Features

How the CNI Works

Explore how the Container Network Interface (CNI) functions within Kubernetes to manage network interfaces for pods. Understand the execution flow of CNI plugins, their role in assigning pod IP addresses, and how they connect container runtimes with the network. This lesson helps you grasp CNI’s design and its importance in flexible and standardized Kubernetes networking.

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 ...