$linuxjunkies
>

CNI plugin

also: CNI, Container Network Interface plugin, network plugin

A Container Network Interface plugin is a software component that manages network connectivity for containers in Kubernetes and other container orchestration systems. It implements the CNI specification to allocate and manage IP addresses, routes, and network interfaces.

CNI plugins are executable programs that follow the Container Network Interface specification, a standardized way for container runtimes to request networking functionality. When a container is created or destroyed, the container runtime calls the appropriate CNI plugin to set up or tear down network resources.

CNI plugins handle critical networking tasks including IP address allocation (IPAM), adding containers to virtual networks, routing configuration, and applying network policies. Common implementations include Flannel, Calico, Weave, and Cilium.

For example, when you deploy a pod in Kubernetes, the kubelet calls the configured CNI plugin, which might allocate a unique IP from a subnet pool, attach the pod's network interface to an overlay network, and configure routing so other pods can reach it.

Related terms