This repository holds the complete implementation of the examples seen in Kubecon Barcelona talk, 2019.
Writing a CNI plugin from scratch / Eran Yanay โ Video | Slides ]
- Two node K8s cluster. Kubeadm works just fine.
- Nodes IPs should be hardcoded into
init.sh
demo.yaml
nodeSelector should be modified according to your cluster node names- Modify
10-my-cni-demo.conf
, withpodcidr
field to correspond to the specific node pod cidr range. Can see podcidr range by runningkubectl describe node
. This should be modified for every node
Deploy into a K8s cluster by following the next steps:
- Copy
my-cni-demo
to/opt/cni/bin/my-cni-demo
- Copy the modified config file to
/etc/cni/net.d/
- Copy the modified init script to each node, and run it at least once after restart. The changes it perform are not persistent.
Apply the demo config yaml by running kubectl apply -f demo.yaml