Skip to content

Cilium ​

Cilium is a CNI (Container Network Interface) for Kubernetes that provides networking between all of the services I run in the cluster.

It also provides useful features like Load Balancing without needing dedicated hardware, which is useful in a lower-budget lab like this one.

Features ​

Let's run through the features of Cilium I use in a little more depth.

Container Networking ​

Cilium, first and foremost, is a CNI. That means it provides networking for all the things running inside the cluster. This includes pods and services. However, it does more than roleplay as a container packet router.

Features:

  • Container networking, replacing components like kube-proxy transparently
  • Provides security for all networking within the cluster by providing transparent encryption for every packet travelling around.
  • Enforces network policies that help prevent unauthorized pods from talking to one another.
  • Improves performance by running its network layer as eBPF programs at the kernel-level.
  • Provides observability for traffic flow using a component called Hubble, allowing an operator (hey, that's me!) to keep tabs on problems routing traffic between pods and services easily.

Load Balancing ​

The cluster uses Cilium as a Load Balancer using BGP.

The way this works is by advertising routes with BGP to my router, which is configured as a BGP peer. These routes are stored by my router and then rebroadcasted to the rest of my network, making the services with type: LoadBalancer in my cluster (like Envoy) available to all the clients connected to my Wi-Fi and over Ethernet.

This allows me to have internal gateways which route traffic through my cluster without having to buy dedicated load balancing hardware or be working in a cloud environment, or figure out a hacky way to route traffic to individual Kubernetes nodes (or, heaven forbid, the pods themselves). For external access, I use Cloudflare Tunnels instead of port forwarding.