demystifying-cni

(โ˜… 120)

Explanation on what a CNI (Container Network Interface) is and how to write it from scratch.

  • 10-demystifying.conf
  • bpf_kpr.c
  • bpf_xdp.c
  • cni-daemonset.png
  • cni-daemonset.yaml
  • cni-high-level.png
  • cni-step-1.png
  • cni-step-2.png
  • cni-step-3.png
  • cni-step-4.png
  • cni-step-5.png
  • cni-step-6.png
  • cni-step-7.png
  • cni-step-8.png
  • demystifying
  • Dockerfile
  • ebpf-hooks.png
  • ebpf-socket.png
  • entrypoint.sh
  • kind.yaml
  • Makefile
  • node-with-two-container.png
  • README.md
  • test.yaml

# Installation Guide

1. Get the code
git clone https://github.com/f1ko/demystifying-cni

Downloads the entire project code from GitHub to your computer.

cd demystifying-cni

Moves into the project folder you just downloaded.

2. Docker

Easy Recommended
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker exec demystifying-cni-control-plane curl -s 10.244.0.20

Type this command into your terminal and run it.

docker build -t demystifying-cni:0.0.1 .

Builds a runnable image based on the Dockerfile.

kind load docker-image demystifying-cni:0.0.1 --name demystifying-cni

Type this command into your terminal and run it.

docker exec demystifying-cni-control-plane curl -m 5 -s 10.96.0.100

Type this command into your terminal and run it.

โœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

Pulled directly from this repo's README.

3. Make

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Make Usually pre-installed on Linux/macOS. On Windows, install separately (e.g. via MSYS2 or WSL).
make bpf-load-kpr

Compiles the code based on the generated build configuration to produce an executable.

โœ… If it finishes without errors, it worked. Try running the generated executable directly.

Pulled directly from this repo's README.

// repository documentation