A CNI plugin configures Linux container network interfaces and related resources according to the Container Network Interface specification. In Kubernetes, it enables pod communication across nodes while keeping the cluster independent of a particular network provider. section 2.3.2 section 6.5
A CNI plugin performs several operational tasks:
- Runs when a pod is scheduled, configuring interfaces, IP addresses, routes, and possibly network policies. section 2.3.2
- Removes the configured network resources when the pod is deleted. section 2.3.2
- Runs as a DaemonSet on cluster nodes and can provide an overlay such as VXLAN for node-to-node traffic. section 6.5
- Can be identified with kubectl get pods -n kube-system or kubectl get ds -n kube-system; its configuration commonly resides under /etc/cni/net.d. section 2.3.2 section 6.5
Inspecting kindnet
A kind cluster uses kindnet as its CNI. Check it with kubectl -n kube-system get ds kindnet, then inspect /etc/cni/net.d/10-kindnet.conflist. The configuration uses the ptp plugin with host-local IPAM, a pod subnet of 10.244.0.0/24, a default route, and port mapping. section 2.3.2
$ kubectl get pods -n kube-system NAME READY STATUS RESTARTS AGE calico-kube-controllers-fdf5f5495-7lzbl 1/1 Running 2 (43m ago) 9d canal-vmgsc 2/2 Running 2 (43m ago) 9d canal-xntjt 2/2 Running 2 (43m ago) 9d coredns-7695687499-27bvx 1/1 Running 1 (43m ago) 9d coredns-7695687499-wfcnf 1/1 Running 1 (43m ago) 9d etcd-controlplane 1/1 Running 3 (43m ago) 9d kube-apiserver-controlplane 1/1 Running 2 (43m ago) 9d kube-controller-manager-controlplane 1/1 Running 2 (43m ago) 9d kube-proxy-nhwwx 1/1 Running 1 (43m ago) 9d kube-proxy-nlw5b 1/1 Running 2 (43m ago) 9d kube-scheduler-controlplane 1/1 Running 2 (43m ago) 9d
Use the kube-system pod listing to identify active networking components, including Calico or other CNI-related workloads. section 2.3.2
