Contents
What eBPF Is
eBPF stands for extended Berkeley Packet Filter. The "Berkeley Packet Filter" part is the historical root — a way to filter network packets in-kernel — but the "extended" is the whole point now: eBPF programs can be attached to a wide range of kernel hooks, not just packet filtering. The mechanics that make it safe are the interesting part:
- A verifier checks every program before it runs. The kernel proves the program terminates and cannot access memory it should not.[5] This is what makes it safe to run third-party code in the kernel.
- Programs run in the kernel, in the fast path. There is no context switch to userspace — which is why eBPF can process every packet or every syscall without the overhead a userspace agent would add.
- Programs are loaded at runtime, version-independent. eBPF programs are compiled to a portable bytecode and JIT-compiled by the kernel, so they survive kernel updates that would break a module.
The practical upshot: a network policy, a tracing probe, or a security sensor can be installed into a running kernel safely and efficiently — which is exactly what the container ecosystem needed.
Why It Matters
Three workloads, each a long-standing pain point, now run on eBPF:
- Networking. Every Kubernetes node runs kube-proxy, the piece that turns a service's virtual address into an actual pod to deliver the traffic to. It does that by programming the node's existing kernel packet-filtering machinery — iptables or IPVS rules — so the rule set grows with the number of services and endpoints in the cluster, and packets pay for walking it. eBPF replaces that with in-kernel load balancing and policy that looks the destination up directly, at far lower latency and CPU cost.
- Observability. eBPF can trace every connection, syscall, and network flow without instrumenting the application — the difference between "add a library" and "attach a probe."
- Security. eBPF can enforce runtime security policy and detect anomalies (a process doing something it never does) at the kernel level, where it is hard to evade.
The common thread is that all three move work into the kernel, where it runs faster and sees everything, rather than sitting in a userspace daemon that has to be told what happened.
The Toolchain: Cilium, Tetragon, Falco
You rarely write eBPF directly; you consume it through tools built on it:
| Tool | What it does with eBPF | Replaces / complements |
|---|---|---|
| Cilium | eBPF-based CNI: in-kernel load balancing, network policy, service mesh | Replaces kube-proxy; complements/replaces Calico |
| Hubble | Cilium's observability layer: a live flow map of cluster traffic | Complements Cilium |
| Tetragon | Runtime security and observability via eBPF tracing of processes and syscalls | Kernel-level security sensor |
| Falco | Runtime threat detection with a rule engine (eBPF or kernel-module driver) | Complements Tetragon; the mature runtime-detection default |
For a Kubernetes estate, the typical entry point is Cilium[1] as the cluster's primary CNI — the Container Network Interface plugin responsible for giving pods their main addresses and carrying traffic between nodes. A cluster normally has one primary CNI, although add-ons such as Multus can attach extra interfaces. Hubble[2] goes on top of Cilium, while Tetragon[3] or Falco[4] adds runtime security. They can be layered because they serve different roles, but their kernel hooks and resource cost still need testing together.
A Worked Example: Replace kube-proxy with Cilium
The canonical eBPF deployment is swapping kube-proxy for Cilium. The workflow, via the Cilium CLI:
- Install Cilium in kube-proxy-replacement mode. This deploys the Cilium agent on every node and tells it to take over service load balancing in-kernel:
# Install Cilium with full kube-proxy replacement
cilium install --kube-proxy-replacement=strict
# Check the rollout and agent health
cilium status
- Verify kube-proxy is actually gone. With strict replacement, kube-proxy should no longer be running, and services should be load-balanced by the eBPF datapath:
# kube-proxy pods should be absent
kubectl get pods -n kube-system | grep kube-proxy
# Run Cilium's connectivity test suite to confirm the datapath works
cilium connectivity test
- Turn on Hubble and watch the flows. Hubble exposes the flow map — the "what is talking to what" view that was previously very hard to get:
# Enable Hubble and open a local UI
cilium hubble enable
cilium hubble ui
The moment that justifies the migration is the first time you open Hubble and see, live, the service-to-service traffic you had only guessed at before. That single view is worth the migration for most teams, independent of the performance win.
Kernel version is the real dependency. eBPF features land in specific kernel versions, and Cilium's most advanced datapath features require a recent-enough kernel (and, for some, specific kernel config). Check the Cilium documentation's kernel-version compatibility table against your nodes before promising the strict kube-proxy replacement; on older kernels you get a reduced feature set, not a failure, but "reduced" matters for what you are trying to do.
Observability and Security
Once the CNI is eBPF-based, the same substrate extends naturally:
- Observability without instrumentation. Hubble shows every flow at L3/L4 — which address talked to which address, on which port — and, with Cilium's Layer 7 features, the HTTP request level on top of that, all without touching the application. That is the difference between "we think service A calls service B" and a live map.
- Runtime security with Tetragon. Tetragon traces process execution and syscalls, so you can answer "did anything spawn a shell inside that container?" after the fact, from kernel events, not from application logs.
- Threat detection with Falco. Falco's rule engine turns kernel events into detections ("a shell spawned in a container that never runs shells") with a mature rules ecosystem.
The pattern to internalize: eBPF is the substrate, and Cilium/Hubble/Tetragon/Falco are the products on top of it. You adopt the substrate once and get networking, observability, and security as layers on the same foundation, rather than three separate agents.
Rollout and Rollback Evidence
eBPF reduces the risk of loading arbitrary kernel code, but a verified program can still enforce the wrong policy or consume too much of a constrained resource. Treat the first rollout like a network change.
- Capture a baseline of service latency, packet loss, CPU, kernel memory, and current network-policy behavior.
- Enable the feature on one node pool or host class. Run connectivity tests for allowed and denied paths, DNS, service discovery, and host-to-pod traffic.
- Exercise the fallback before expanding: remove the program or return the cluster to the prior datapath, then verify routes and policies converge cleanly.
- Alert on program-load failures, verifier rejections, map pressure, attach-point errors, and unexpected policy drops. An empty flow dashboard is not proof that traffic is healthy.
Expansion gate: move beyond the canary only after both the intended enforcement and the rollback path have passed automated connectivity tests.
Caveats
eBPF is powerful and mature, but it is not free of constraints:
- Kernel coupling. The feature set tracks your kernel version. An old kernel means a subset of the datapath features.
- Privileges. Loading eBPF programs requires elevated privileges (or the right capabilities), which has its own security implications — an eBPF agent is a high-privilege component that must itself be trusted and updated.
- A new debugging model. When traffic is handled in-kernel by eBPF, "where did this packet go" is answered with Cilium/Hubble tooling, not the iptables/tcpdump habits of the past. That is a real re-learning curve for the network team.
None of these outweighs the win for a Kubernetes estate that has outgrown kube-proxy — but they are the reason eBPF is a deliberate platform adoption, not a drop-in flag.
References
- Cilium — "Cilium" documentation: eBPF-based networking, kube-proxy replacement, and network policy. Cilium Project / Isovalent, current.
- Cilium — "Hubble" documentation: eBPF-based network observability and the flow map. Cilium Project, current.
- Tetragon — "Tetragon" documentation: eBPF runtime security and observability. Isovalent / Tetragon Project, current.
- Falco — "Falco" documentation: runtime threat detection and the rule engine. Falco Project / CNCF, current.
- Linux kernel — "eBPF" and the verifier documentation: the eBPF architecture and safety model. Linux kernel documentation, current.