Series
Building a Kubernetes CNI From Scratch
3 articles in reading order.
Building a Kubernetes CNI From Scratch (Part 1): Why Your Fresh Cluster Doesn't Work
You installed Kubernetes with kubeadm, joined your worker nodes, but nothing works. In this first article of the series, we explore why Kubernetes cannot function without a Container Network Interface (CNI), how the CNI fits into the pod lifecycle, and what actually happens before your pod ever receives an IP address.
Building a Kubernetes CNI From Scratch (Part 2): Linux Namespaces, cgroups and the Building Blocks of Container Networking
Before writing a CNI plugin, we need to understand the Linux primitives that make container networking possible. In this article, we explore Linux namespaces, cgroups, the pause container, and how Kubernetes isolates networking under the hood.
Building a Kubernetes CNI From Scratch (Part 3): Writing a Bash CNI Plugin
In this article, we build the first working version of our Kubernetes CNI plugin using Bash. We create a Linux bridge, allocate pod IPs, create veth pairs, connect pods to the host, and return a valid CNI result to containerd.