eBPF-Based Networking in Kubernetes: A Cilium Deep Dive

eBPF-Based Networking in Kubernetes: A Cilium Deep Dive

How small, safe programs running inside the Linux kernel replace piles of firewall rules, give every workload a real identity, and make cluster networking faster, safer and far easier to see, explained from the ground up with no code required.

Picture a huge school with thousands of rooms and a single front-office clerk who checks every visitor against a very long printed list. For each person who walks in, the clerk starts at the top of the list and reads down line by line until a matching rule is found. When the school had fifty rooms this was fine. Now it has fifty thousand, the list is miles long, and a queue snakes out of the door. A smarter school would hand every hallway its own tiny, fast guard who knows exactly who belongs where, recognises people by their badge instead of by the room they happen to stand in, and writes down everything that happens in a notebook anyone can read. Kubernetes networking has been moving in exactly this direction. The tiny guards are called eBPF programs, the badge system is called identity, and the project that puts it all together is called Cilium. This guide explains every piece, one step at a time.

1Why Kubernetes Networking Needed a Rethink

The classic tools worked well until clusters became large, busy and constantly changing.

Kubernetes makes a bold promise about networking. Every Pod gets its own IP address, every Pod can talk to every other Pod without clumsy address translation, and Services give groups of Pods a stable name and address that survives restarts. Behind that friendly promise, something has to actually move the packets, balance the traffic across healthy Pods and enforce the rules about who may talk to whom.

For many years, the answer relied heavily on a Linux feature called netfilter and its command-line companion iptables. A component named kube-proxy watched the cluster and wrote iptables rules so that traffic sent to a Service address was redirected to one of the Pods behind it. Network policies were turned into more rules. This approach is simple and battle tested, but it was never designed for a world where thousands of Services and tens of thousands of Pods appear and disappear every hour.

Problem 1

Long lists get slow

iptables checks rules in order, so the cost of finding the right rule grows with the number of Services. Updating a huge rule set also takes noticeable time and can briefly disturb traffic.

Problem 2

Addresses are fragile

Rules written in terms of IP addresses must be rewritten every time a Pod moves or restarts, because its address changes. Security that depends on addresses is always chasing a moving target.

Problem 3

Little visibility

When a connection fails, it is hard to see which rule dropped it and why. Engineers end up reading thousands of rules and guessing.

Problem 4

Coarse policy

Standard network policy understands addresses and ports, but not web paths, domain names or the identity of the calling workload.

Simple Analogy

A telephone switchboard operator with a paper directory could connect a few hundred callers happily. As the town grows to millions of callers, who keep changing their numbers every day, the directory becomes impossible to keep up to date by hand. The town needs automatic exchanges that look up numbers instantly. eBPF-based networking is that automatic exchange.

Linear
how rule lookup cost grows in long iptables chains
Constant
how lookup cost behaves in eBPF hash tables
Identity
what replaces fragile IP addresses in policy
i
The Short Version

Cilium uses eBPF to move the work of routing, load balancing, policy and observation into small programs inside the Linux kernel, where lookups are fast, decisions are based on workload identity, and every packet can be watched.

2Kubernetes Networking in Plain Words

A quick tour of the pieces that any networking add-on has to provide.

Before diving into Cilium, it helps to be clear about what Kubernetes itself expects from the network. The rules are short and elegant. Every Pod receives a unique IP address. Pods on the same machine and on different machines can reach each other directly using those addresses. Agents on a node can reach all the Pods on that node. Kubernetes does not build this network itself. It delegates the job to a plugin that follows a standard called the Container Network Interface, usually shortened to CNI.

The jobs of a network plugin

When the kubelet starts a Pod, it asks the container runtime to create an isolated network space for it. The runtime then calls the CNI plugin, which has three tasks. It gives the Pod an address, it connects the Pod’s network space to the rest of the node and cluster, and it removes everything again when the Pod is deleted. Cilium is a CNI plugin, but as you will see, it does far more than these three basics.

Services and who does the load balancing

Pods are temporary and their addresses change. A Service solves this by offering one stable virtual address that fronts a changing set of Pods. Something on every node must translate that virtual address into the address of a real, healthy Pod. In most clusters that something is kube-proxy. In a Cilium cluster, it can be Cilium itself, using eBPF, which is why you will often hear the phrase kube-proxy replacement.

Network policy

By default, every Pod can talk to every other Pod, which is convenient and dangerous. Kubernetes offers an object called NetworkPolicy so that teams can say which Pods may talk to which. The API only defines the rules. A plugin must actually enforce them, and not every plugin does. Cilium enforces them, and offers richer rules of its own.

JobWho defines itWho performs it
Give a Pod an address and connect itCNI standardThe network plugin, such as Cilium
Stable virtual address for PodsService objectkube-proxy or Cilium
Who may talk to whomNetworkPolicy objectThe network plugin
Seeing what traffic flowsNobody, by defaultAdd-ons such as Hubble
Simple Analogy

Think of a city. The city rules say every house must have an address and be reachable by road. The road builder, the postal service and the security guards are separate jobs. Kubernetes writes the city rules, and a network plugin does the building, the delivering and the guarding.

i
Choosing a Plugin Matters

Because Kubernetes leaves the real work to the plugin, the plugin you choose decides your cluster’s speed, security options and troubleshooting experience. It is one of the most important early decisions.

3What Is eBPF?

A safe way to teach the Linux kernel new tricks without rebuilding it.

The kernel is the core of the operating system. It manages memory, schedules programs and moves every network packet. For decades, adding new behaviour to the kernel meant either changing its source code, which takes years to reach users, or loading a kernel module, which is powerful but risky, because a bug in a module can crash the entire machine.

eBPF offers a third path. The name once stood for extended Berkeley Packet Filter, though today it is simply used as a name. It lets you write small programs that run inside the kernel in a sandbox. Before a program is allowed to run, the kernel inspects it with a component called the verifier. The verifier proves the program cannot loop forever, cannot read memory it should not touch and cannot crash the system. Only programs that pass are accepted, then translated into fast machine code and attached to a hook, which is a specific moment in the kernel’s life when the program should run, such as the instant a packet arrives.

Simple Analogy

Imagine an airport. Adding a new security rule used to mean rebuilding part of the terminal. eBPF is like letting approved inspectors place small, pre-checked scanners at any gate. Before a scanner is installed, the airport authority tests it thoroughly to make sure it cannot jam the gate. Once approved, it runs at full speed exactly where the passengers pass.

flowchart LR
    A["Developer writes a small program"] --> B["Compiled to eBPF bytecode"]
    B --> C["Kernel verifier checks safety"]
    C -->|Rejected| D["Program is refused"]
    C -->|Accepted| E["Translated to machine code"]
    E --> F["Attached to a kernel hook"]
    F --> G["Runs on every matching event"]
    G  H["Shared eBPF maps hold state"]
        
FIG 1 — The life of an eBPF program, from source to running safely inside the kernel

Three ideas to hold on to

First, eBPF programs are event driven. They do nothing until something happens, such as a packet arriving or a connection starting. Second, they are small and fast, because they run in the kernel without switching back and forth to ordinary programs. Third, they can remember things through eBPF maps, which are tables shared between the kernel programs and the ordinary programs that control them.

!
Not Magic, Not Everywhere

eBPF depends on the Linux kernel, and many of its features arrived gradually in newer kernel versions. A cluster running an old kernel may not support everything Cilium can do. Always check the supported kernel versions before planning an installation.

4eBPF Hooks and Maps Used for Networking

Where the little programs attach, and where they keep their notes.

The power of eBPF for networking comes from the number of places where a program can be attached. Each place sees traffic at a slightly different moment, and Cilium picks the best one for each job.

Hook

XDP

The earliest point, right when a packet comes off the network card, before the kernel has done much work. Ideal for dropping unwanted traffic extremely cheaply and for fast load balancing at the edge of a node.

Hook

Traffic control ingress and egress

Attached to network interfaces, including the virtual interface of every Pod. This is where Cilium makes most of its per-packet decisions about identity, policy and forwarding.

Hook

Socket and control group hooks

Triggered when an application opens a connection, not when packets move. Cilium can pick the final destination Pod for a Service at this moment, before any packet exists.

Hook

Tracing points

Hooks into kernel functions and events that let observability and runtime security tools watch what processes do, without changing the programs they watch.

State

Maps

Kernel tables, such as hash tables, arrays and ring buffers, that store things like Service backends, identities, connection tracking and policy rules. Lookups in a hash table take roughly the same time however big the table is.

Help

Helper functions

A fixed menu of safe kernel services that programs may call, such as reading the time, redirecting a packet or looking up a map entry.

HookWhen it runsTypical Cilium use
XDPPacket just arrived at the network cardEarly filtering and fast external load balancing
Traffic controlPacket enters or leaves an interfacePod identity, policy, forwarding, connection tracking
Socket and control groupAn application connects or sendsService translation at connection time
TracingA kernel function or event firesObservability and runtime visibility
Simple Analogy

Imagine a building with several checkpoints: a gate at the street, a door at every apartment, and a reception desk that notices when someone picks up the phone to call another apartment. Each checkpoint sees something different, and a good security team puts the right guard at the right checkpoint.

Why maps matter so much

Maps are the memory of the datapath. When Cilium learns that a Pod belongs to a certain identity, it writes that fact into a map, and the kernel programs read it at full speed. When a Service gains a new backend Pod, the agent updates one entry in a map, instead of rewriting a long list of rules. This is a big part of why eBPF scales so smoothly: small updates to hash tables replace large rewrites of ordered lists.

i
Maps Have Sizes

Each map has a fixed capacity chosen when it is created. Sizing maps sensibly for the number of Pods, Services and connections in the cluster is a real operational task, and we will return to it later.

5Meet Cilium

An open source project that turns eBPF into a complete Kubernetes networking platform.

Cilium is an open source project, created originally by the company Isovalent and now developed by a wide community. It is a graduated project of the Cloud Native Computing Foundation, which is the foundation’s highest maturity level and signals broad adoption and healthy governance. Several managed Kubernetes offerings from cloud providers build on Cilium for their networking layer, which is one reason it has become so widely used.

At its core, Cilium is a CNI plugin that uses eBPF for its datapath, which means the path that packets take. Around that core sits a growing family of capabilities, all built on the same foundation. It is helpful to see these capabilities as layers that you can switch on as needed.

Layer 1

Connectivity

Gives Pods addresses and moves packets between them, within a node, between nodes and out to the world, using overlay or direct routing.

Layer 2

Service load balancing

Replaces kube-proxy with eBPF, handling ClusterIP, NodePort and external load balancing.

Layer 3

Network security

Identity-based policy at layers three to seven, DNS-aware rules, a host firewall and transparent encryption.

Layer 4

Observability

Hubble shows flows, drops, DNS and service dependencies, drawn from the datapath itself.

Layer 5

Service mesh and ingress

Ingress and Gateway API support and sidecar-free mesh features using a shared per-node proxy.

Layer 6

Multi-cluster

Cluster Mesh connects several clusters so that Services and policies can span them.

Simple Analogy

Think of a smartphone. At its heart is a chip that does the real work. On top of it you get a phone, a camera, a map and a wallet, all using the same chip. Cilium’s eBPF datapath is the chip, and routing, load balancing, security and observability are the apps that share it.

Features come from one foundation

A subtle benefit of this design is consistency. Because routing, policy and observation all use the same identity information and the same kernel programs, they agree with each other. The flow that Hubble displays is the same flow the policy engine judged. In a stitched-together setup of separate tools, those views can disagree, which makes troubleshooting painful.

!
You Do Not Need Everything

Cilium is a large toolbox. Many teams start with basic connectivity and policy, then add kube-proxy replacement and Hubble, and adopt the service mesh or multi-cluster features only if they have a clear need. Each extra feature adds something to learn and operate.

6Cilium Architecture

The programs, objects and tables that make up a Cilium installation.

A Cilium installation has a small number of moving parts. Most of the real work happens in one agent that runs on every node. Understanding what each part does makes it much easier to troubleshoot later.

flowchart TD
    K["Kubernetes API server"] --> OP["Cilium operator: cluster-wide tasks"]
    K --> AG1["Cilium agent on node 1"]
    K --> AG2["Cilium agent on node 2"]
    AG1 --> BPF1["eBPF programs and maps on node 1"]
    AG2 --> BPF2["eBPF programs and maps on node 2"]
    BPF1 --> HU1["Hubble observer on node 1"]
    BPF2 --> HU2["Hubble observer on node 2"]
    HU1 --> HR["Hubble Relay"]
    HU2 --> HR
    HR --> UI["Hubble UI and command line"]
    AG1 --> EN1["Envoy proxy for layer seven"]
        
FIG 2 — Agents on every node program the kernel, while the operator and Hubble components work across the cluster
Per node

Cilium agent

Runs on every node. It watches the Kubernetes API, decides what each Pod needs, compiles and loads eBPF programs, and keeps the maps up to date. It is the brain of the node.

Per node

CNI plugin

A small program the container runtime calls when a Pod starts or stops. It asks the agent to set up or remove the Pod’s networking.

Cluster wide

Cilium operator

Handles tasks that should happen once for the whole cluster, such as managing address pools and cleaning up stale objects.

Observability

Hubble

An observer on each node reads flow events from the datapath. A relay gathers them from all nodes, and a command line tool and a web interface display them.

Layer seven

Envoy proxy

A well-known proxy used when policy or features need to understand application protocols such as HTTP. Traffic is handed to it only when needed.

Multi-cluster

Cluster Mesh API server

Shares identities and Service information between clusters when several are joined together.

Custom objects that describe the state

Cilium stores much of its knowledge as Kubernetes custom resources. There are objects for security identities, for endpoints, for node information and for the richer policies that Cilium adds. Because they live in the Kubernetes API, they can be listed, inspected and managed with the same tools as everything else, and they fit naturally into configuration stored in version control.

Object kindWhat it holds
CiliumNetworkPolicy and the cluster-wide variantRicher policy rules than the standard policy object
CiliumIdentityA numeric identity linked to a set of labels
CiliumEndpointFacts about a Pod’s network presence, such as its identity and address
CiliumNodePer node information, including address ranges
i
Agent Restarts

Because the eBPF programs and maps live in the kernel, existing Pods generally keep their connectivity while the agent restarts or is upgraded. The agent reconnects to the state already in the kernel and reconciles it.

7Identity-Based Networking

The idea that makes Cilium policy stable even when addresses keep changing.

The most important concept in Cilium is that security is based on identity, not address. Traditional firewalls say “allow traffic from address 10.0.4.17 to address 10.0.9.3.” In a cluster, that is almost meaningless, because the Pod at 10.0.4.17 may be replaced a minute from now by a different Pod, and the address could be handed to something unrelated.

Cilium instead looks at the labels attached to a Pod. Labels are the tags that Kubernetes already uses to organise things, such as which application a Pod belongs to and which environment it runs in. Cilium takes the set of relevant labels, gives that set a number called a security identity, and assigns that identity to every Pod that carries the same labels. All the replicas of the same application share one identity, no matter how many exist or where they run.

Simple Analogy

A school does not decide who may enter the science lab by memorising where each student’s desk is. It checks the colour of their badge. Everyone in the “science club” gets the same badge colour, new members receive it automatically, and the lab’s rule simply says “science badges allowed.” Moving desks changes nothing.

sequenceDiagram
    participant P as New Pod
    participant A as Cilium agent
    participant K as Kubernetes API
    participant M as eBPF maps
    P->>A: Pod starts, networking requested
    A->>K: Read the Pod's labels
    A->>A: Work out the identity for this label set
    A->>K: Create or find the matching identity object
    A->>M: Record this Pod address with its identity
    Note over M: Every node learns the address to identity mapping
        
FIG 3 — From Pod labels to a security identity stored where the datapath can read it

How identity travels with traffic

Every node keeps a table, often called the IP cache, that maps Pod addresses to identities. When a packet arrives, the datapath looks up the sender’s address and learns its identity almost instantly. When traffic travels between nodes through an overlay tunnel, the sender’s identity can even be carried inside the tunnel header, so the destination does not need to look it up. Policy is then checked using identities: is the sender’s identity allowed to reach the receiver?

Why this scales

A policy that says “the frontend identity may reach the payments identity on one port” is just one small rule, however many Pods exist. Adding fifty replicas adds no new rules, because they share the identity. The number of identities depends on the number of distinct label combinations, not the number of Pods, which keeps policy tables compact.

!
Beware of Noisy Labels

If a label changes for every Pod, such as a unique hash or a build number, and Cilium counts it as part of the identity, then every Pod could receive its own identity. That defeats the savings and can strain the system. Cilium lets operators choose which labels are relevant for identity, and sensible choices matter.

ApproachWhat policy is based onWhat happens when a Pod restarts
Address-based firewallIP addresses and portsRules must be rewritten for the new address
Identity-based, as in CiliumLabel-derived identityThe new Pod gets the same identity, and no rule changes

8The Journey of a Packet

Following one connection from a Pod on one node to a Pod on another.

The best way to understand a datapath is to follow a packet. Suppose a frontend Pod wants to talk to a backend Pod. Here is the story in the order it happens.

1

The application connects

The frontend opens a connection, usually to a Service name. If socket-level load balancing is on, Cilium swaps the Service address for a real backend Pod address right at this moment, before any packet is built.

2

The packet leaves the Pod

The packet crosses the Pod’s virtual network cable to the node. A Cilium eBPF program attached to that cable wakes up and begins its checks.

3

Identity and policy

The program knows the sender’s identity, looks up the destination’s identity in the maps, and checks whether the policy allows this conversation. If not, the packet is dropped and the drop is recorded for Hubble.

4

Connection tracking

The program notes the connection in a tracking table, so that the reply traffic is recognised and later packets of the same connection take a fast path.

5

Forwarding

If the destination is on the same node, the program can hand the packet straight to the other Pod’s cable. If it is on another node, the packet is sent over the network, either wrapped in a tunnel or routed directly.

6

Arrival

On the destination node, another eBPF program receives the packet, learns the sender’s identity, applies the destination’s policy and delivers it to the backend Pod.

sequenceDiagram
    participant F as Frontend Pod
    participant N1 as Node 1 eBPF
    participant N2 as Node 2 eBPF
    participant B as Backend Pod
    F->>N1: Packet leaves the Pod
    N1->>N1: Identity lookup, policy check, connection tracking
    N1->>N2: Forward across the network
    N2->>N2: Learn sender identity, apply receiving policy
    N2->>B: Deliver packet
    B-->>N2: Reply
    N2-->>N1: Reply travels back using the tracked connection
    N1-->>F: Reply delivered
        
FIG 4 — A packet is checked on both ends, and replies follow the tracked connection
Simple Analogy

A letter inside a large company goes first through the sender’s mail desk, which checks the sender’s badge and the allowed recipients, then travels between buildings, and finally passes the recipient building’s mail desk, which checks again before delivery. Both desks apply the company rules, and both write down that the letter passed.

i
Shortcuts on the Same Node

When both Pods live on the same node, Cilium can redirect the packet directly from one Pod’s virtual cable to the other, skipping much of the normal kernel networking path. This is one of the places where eBPF saves real work.

9Addressing and Routing Modes

How Pods get addresses and how their traffic crosses the physical network.

Where Pod addresses come from

Cilium offers several ways to hand out Pod addresses, called IP address management modes. The default gives each node a slice of a cluster-wide range, and the operator manages the slices. Other modes follow the Kubernetes node settings, or integrate with a cloud provider’s own network interfaces, so that Pods receive real addresses from the cloud network. Choosing a mode is mainly a question of how much you want the Pod network to blend with the surrounding network.

Two ways to cross the network

Pods on different nodes must reach each other over the physical network. Cilium supports two broad styles. In encapsulation mode, also called overlay, each packet is wrapped inside another packet that carries node addresses, using a tunnel format such as VXLAN or Geneve. The physical network only needs to know how to deliver traffic between nodes and never has to understand Pod addresses. In native routing mode, Pod packets travel unwrapped, and the surrounding network, or a routing protocol, must know how to reach every Pod range.

Overlay: Advantages

  • Works on almost any underlying network
  • Needs no changes to routers or cloud route tables
  • Can carry identity inside the tunnel header
  • Quick to set up

Overlay: Trade-offs

  • Small overhead for wrapping each packet
  • Smaller usable packet size unless adjusted
  • Harder for outside tools to see real Pod addresses

Native routing: Advantages

  • No wrapping overhead, so a little faster
  • Pod addresses are visible to the wider network
  • Plays well with cloud networks that already route Pod ranges

Native routing: Trade-offs

  • The network must learn how to reach every Pod range
  • More planning and coordination with network teams
  • Address ranges must be carefully managed
QuestionOverlayNative routing
Does the network need to know Pod ranges?NoYes
Setup effortLowHigher
Per packet overheadSmall extra headerNone
Best forQuick starts, mixed or restricted networksCloud and data centre networks with route control
Simple Analogy

Overlay is like putting every letter inside a courier’s envelope. The postal network only reads the outer address, so it can deliver anywhere. Native routing is like teaching the whole postal network the inner addresses, which is faster but requires everyone to agree on the address book.

!
Plan Address Ranges Early

Pod and node address ranges are hard to change later. Choose ranges that do not overlap with your corporate network or with other clusters you may want to connect one day, especially if you plan to use Cluster Mesh.

10Service Load Balancing Without kube-proxy

Replacing long rule lists with fast table lookups.

Services are where eBPF delivers some of its most visible benefits. In the classic design, kube-proxy turns each Service into a set of iptables rules. A packet sent to a Service address walks down a chain of rules until one matches, and then another set of rules picks a backend. With thousands of Services, this chain is long, and every change to a Service means rewriting rules.

Cilium replaces this with eBPF maps. One map holds the Services and their backends, and a lookup finds the answer in roughly constant time, however many Services exist. When a backend appears or disappears, the agent changes a single entry. The behaviour is the same from the application’s point of view, but the cost of getting there is much lower and much more predictable.

flowchart LR
    subgraph OLD["Classic kube-proxy with iptables"]
        direction TB
        A1["Packet to Service address"] --> A2["Walk rule 1"]
        A2 --> A3["Walk rule 2"]
        A3 --> A4["...thousands of rules..."]
        A4 --> A5["Match found, pick a backend"]
    end
    subgraph NEW["Cilium with eBPF maps"]
        direction TB
        B1["Connection or packet to Service address"] --> B2["One hash lookup"]
        B2 --> B3["Backend chosen"]
    end
        
FIG 5 — Long ordered rule chains are replaced by a single table lookup

Socket-level load balancing

For traffic between Pods inside the cluster, Cilium can pick the backend at the moment the application connects. The program attached to the socket rewrites the destination from the Service address to a real Pod address before the first packet is created. After that, packets flow straight to the chosen Pod with no per-packet address translation. The application never knows, and no extra translation work is done for the life of the connection.

External traffic and NodePorts

Traffic that arrives from outside the cluster, for example through a NodePort or a load balancer, is handled in the packet path. Cilium selects a backend, and may use a technique called direct server return, in which the reply travels straight from the backend to the client instead of passing back through the node that first received the request. It can also use consistent hashing, so that a change in the set of backends moves as few existing connections as possible.

FeatureWhat it doesBenefit
Hash table lookupFinds Service backends in roughly constant timeSpeed that does not degrade with many Services
Socket-level translationChooses the backend when a connection startsNo per-packet address rewriting inside the cluster
Direct server returnReplies skip the first nodeLess load and lower delay on the entry node
Consistent hashingKeeps most flows on the same backend when backends changeFewer broken connections during scaling
Simple Analogy

Instead of a receptionist scanning a long printed list for the right extension every time someone calls, the company installs a quick-dial directory where each name leads straight to the right extension. Adding a new employee means adding one line, not reprinting the whole list.

i
Measure Before You Promise

The gains from replacing kube-proxy depend on cluster size, traffic patterns and kernel version. Large clusters with many Services benefit most. Always benchmark with your own workloads before promising a specific improvement.

11Network Policy at Layers Three and Four

Controlling who may talk to whom, using identity instead of addresses.

Cilium enforces the standard Kubernetes NetworkPolicy and adds its own richer policy objects. A policy chooses a group of Pods by labels and then lists what traffic is allowed in or out. Those rules can refer to other groups of Pods by their labels, to whole namespaces, to address ranges outside the cluster, or to special named entities such as the nodes themselves, the Kubernetes API server or the outside world.

How the default changes

Without any policy, Pods accept all traffic. The moment a policy selects a Pod for a given direction, that Pod switches to deny by default for that direction, and only the traffic that some policy explicitly allows is let through. This is a common source of surprise: adding a first small policy can suddenly block traffic that used to work, because the Pod has moved from open to closed. Planning the policy as a whole, rather than one rule at a time, avoids outages.

flowchart TD
    A["Packet arrives with sender identity"] --> B{"Does any policy select the receiving Pod for this direction?"}
    B -->|No| C["Allow"]
    B -->|Yes| D{"Is there an explicit deny rule that matches?"}
    D -->|Yes| E["Drop and record the reason"]
    D -->|No| F{"Is there an allow rule that matches identity, port and protocol?"}
    F -->|Yes| G["Allow"]
    F -->|No| E
        
FIG 6 — The policy decision: open by default, closed once selected, deny rules take priority
Rule type

Allow by identity

Permit traffic from Pods with certain labels to Pods with other labels on chosen ports.

Rule type

Deny rules

Cilium’s own policy objects can state explicit denials, which take priority over allows and are useful for carving out exceptions.

Rule type

Entities

Named groups such as the cluster, the host, the API server or the world, so policy reads clearly without listing addresses.

Rule type

Address ranges

Allow or deny traffic to outside ranges when identities do not apply, such as a legacy system on a fixed network.

Scope

Namespaced and cluster-wide

Teams can own policies in their namespaces, while platform teams define cluster-wide guardrails that apply everywhere.

Scope

Host firewall

The same policy language can protect the nodes themselves, not only the Pods running on them.

Simple Analogy

A classroom door is open all day until the teacher posts a guest list. As soon as there is a list, only people on it may enter, and everyone else is turned away. A teacher who adds a list for just one visitor might accidentally lock out the whole class.

!
Do Not Forget the Basics

When you lock down a namespace, remember that Pods also need to reach cluster DNS and often the metrics and health systems around them. Policies that forget DNS are one of the most common causes of mysterious failures after a lockdown.

12Layer Seven and DNS-Aware Policy

Going beyond addresses and ports to understand what applications are actually saying.

Layers three and four describe where traffic goes and on which port. Layer seven describes what the application is asking for. Two Pods may both talk to the same service on the same port, yet one only reads data while the other tries to delete it. A policy that cannot tell these apart is too blunt. Cilium can enforce rules that understand protocols such as HTTP, allowing a particular method and path while blocking others.

How layer seven rules are applied

Understanding application protocols requires parsing the traffic, which is more work than checking an identity and a port. When a policy contains such rules, Cilium steers the matching traffic through an Envoy proxy that runs on the node. The proxy examines each request, applies the rules and passes allowed requests along. Traffic that needs no such inspection never touches the proxy and stays on the fast eBPF path.

DNS-aware policy

Many workloads must reach outside services by name, such as a payment provider or a package repository. The addresses behind those names change often, so writing the addresses into policy is hopeless. Cilium offers rules based on domain names. A DNS proxy watches the lookups that Pods make, notes which addresses were returned for allowed names, and permits traffic to just those addresses for a limited time. Pods can therefore be allowed to reach one named service and nothing else on the internet.

Read-only access

A reporting service may only send read requests to an API. A layer seven rule allows the read method on the right paths and blocks writes, so even a compromised reporting service cannot change data.

Controlled outbound access

A billing service may call exactly one external payments domain. A name-based rule permits that domain and blocks every other destination, shrinking the damage if the service is ever taken over.

Preventing data theft

By allowing outbound traffic only to a short list of named destinations, teams make it much harder for malicious code to send secrets to an attacker’s server.

Advantages

  • Rules that match how applications really behave
  • Stable policy for external services whose addresses change
  • No sidecar needed in every Pod
  • Proxy is used only where a rule requires it

Disadvantages / Trade-offs

  • Inspected traffic costs more than plain eBPF forwarding
  • Only some protocols are understood
  • Encrypted application traffic limits what can be inspected
  • More rule complexity to maintain and test
i
Use It Surgically

Apply layer seven rules to the few paths where precision matters most, and keep the rest on simple identity and port rules. This keeps performance high while still gaining the extra control.

13Encryption and Mutual Authentication

Protecting traffic in transit and proving who is on the other end.

Inside a cluster, traffic between Pods normally travels in plain form across the node network. Anyone who can watch that network, such as a compromised machine or a careless tap, could read it. Cilium offers transparent encryption between nodes, meaning applications need no changes at all. The nodes simply encrypt traffic as it leaves one and decrypt it as it arrives at the other.

Option 1

WireGuard

A modern, lean encryption technology built into the Linux kernel. It is generally simple to enable and manage, and it is a common choice in new installations.

Option 2

IPsec

A long-established standard with wide compatibility. It is more involved to configure, with keys that must be managed, but suits environments that already rely on it.

Proving identity, not just hiding traffic

Encryption keeps eavesdroppers out, but it does not prove that the other end is who it claims to be. Cilium has been developing mutual authentication, in which workloads prove their identity to each other using standard workload identity documents before traffic is allowed. This links the idea of Cilium identity to cryptographic proof. It is an area that has been evolving quickly, so check the current status and limits in the documentation before relying on it for critical needs.

ProtectionWhat it stopsWhat it does not do
Node-to-node encryptionEavesdropping on the network between nodesDoes not stop a compromised Pod from talking to allowed peers
Identity-based policyUnauthorised connections between workloadsDoes not hide the content of allowed traffic on the wire
Mutual authenticationImpersonation of a workloadIs still maturing, and adds some complexity
Application-level encryptionReading data at any point on the pathMust be added by the application owners
Simple Analogy

Putting a letter in a sealed envelope keeps the postman from reading it, but does not prove who wrote it. Showing a signed ID card proves who you are, but does not hide your words. A careful system uses both: the sealed envelope and the signed ID.

!
Encryption Has a Cost

Encrypting every packet uses processor time and can reduce throughput. Measure the effect on your workloads, and consider encrypting only where compliance or risk demands it.

14Hubble: Seeing the Network

Turning the datapath into a window that engineers can look through.

One of the most loved parts of Cilium is Hubble, its observability layer. Because eBPF programs already look at every packet to make decisions, they can also report what they saw at almost no extra cost. Hubble collects those reports, enriches them with Kubernetes information such as Pod names, namespaces and labels, and presents them in a way people can understand.

flowchart LR
    A["eBPF programs see each flow"] --> B["Event buffer on the node"]
    B --> C["Hubble observer adds Pod and label names"]
    C --> D["Hubble Relay combines all nodes"]
    D --> E["Command line tool"]
    D --> F["Web interface with service map"]
    C --> G["Metrics for Prometheus"]
        
FIG 7 — Flow events travel from the kernel to people and dashboards

What you can see

For every flow, Hubble can show who talked to whom, using names rather than raw addresses, on which port and protocol, and what the verdict was. A verdict says whether the traffic was forwarded or dropped, and a dropped flow comes with a reason, such as being denied by policy. For supported protocols, Hubble also shows the application level details, like the HTTP method and response status, and the DNS names that were looked up.

View

Flows

A live stream of connections with source, destination, verdict and reason.

View

Service map

A drawing of which services talk to which, built automatically from real traffic.

View

DNS and HTTP

Names being resolved and requests being made, with response codes and latency.

View

Metrics

Counters and histograms exported to a monitoring system for dashboards and alerts.

A troubleshooting story

A team sees that a new service cannot reach its database. Without good tools, they would read policies, compare labels and guess. With Hubble, they filter flows from the service to the database and immediately see a dropped verdict with the reason “denied by policy.” The missing rule is obvious. What might have taken an afternoon takes a few minutes. This is the practical value of observability that is built into the datapath.

Simple Analogy

A building with guards at every door but no logbook leaves you guessing when something goes missing. A building where every guard writes down who passed, who was turned away and why makes investigations simple. Hubble is that logbook, readable by anyone with permission.

!
Flow Data Is Sensitive

Flow records show which services talk to each other and sometimes request details. Protect Hubble with encrypted connections and access control, and decide carefully who may see which namespaces.

15Service Mesh Without Sidecars, Ingress and Gateway API

Getting mesh-like features without adding a helper container to every Pod.

A service mesh adds features such as smart traffic routing, retries, secure service-to-service connections and detailed metrics. The traditional way to provide them is to inject a sidecar proxy into every Pod. That works, but it multiplies the number of containers, adds memory and processor cost to each Pod, and complicates upgrades because every Pod must be restarted to pick up a new proxy.

Cilium offers a different approach. Because eBPF already steers traffic in the kernel, it can send only the traffic that needs layer seven treatment to a shared proxy on the node, instead of to a proxy in every Pod. The same node-level proxy also serves ingress traffic entering the cluster, and Cilium implements both the older Ingress API and the newer Gateway API, which is the modern Kubernetes standard for describing how external traffic reaches Services.

Sidecar-free: Advantages

  • No extra container in every Pod
  • Less memory and processor overhead per workload
  • Upgrades do not require restarting application Pods
  • Only traffic that needs it pays the proxy cost

Sidecar-free: Trade-offs

  • Shared proxy means shared fate within a node
  • Fine-grained per-workload proxy tuning is harder
  • Feature coverage differs from long-established meshes
  • Newer approach, so check maturity for your needs
QuestionSidecar per PodPer-node proxy with eBPF
Extra containersOne per PodNone in your Pods
Resource costGrows with Pod countGrows with node count
Upgrade impactPods must restartNode component is rolled
Isolation between workloadsStrong, each has its own proxyShared proxy on the node
Simple Analogy

Giving every student their own personal translator is thorough but expensive. Stationing one translator in each hallway, who only steps in when a conversation actually needs translating, costs far less. The trade-off is that students in the same hallway share the translator.

i
Choose by Need

If your main goal is secure, observable and policy-controlled connectivity, Cilium’s built-in features may be enough. If you need an advanced traffic management feature set that only a dedicated mesh offers, evaluate that mesh as well.

16Cluster Mesh and Multi-Cluster Networking

Joining several clusters so they behave like parts of one network.

Real organisations rarely run a single cluster. They run several, for different regions, teams, environments or failure domains. Out of the box, each cluster is an island, with its own Services and its own policies. Cilium Cluster Mesh connects clusters so that Pods in one can reach Pods and Services in another directly, with identity-based policy that works across them.

flowchart LR
    subgraph CA["Cluster A"]
        A1["Frontend Pods"]
        A2["Mesh API server"]
    end
    subgraph CB["Cluster B"]
        B1["Backend Pods"]
        B2["Mesh API server"]
    end
    A2  B2
    A1 -->|"Direct Pod to Pod traffic"| B1
        
FIG 8 — Clusters share identities and Service information so Pods can reach each other directly

Global Services

The headline feature is the global Service. A Service with the same name and namespace in several clusters can be marked as global, and Cilium load balances across the backends in all of them. If the backends in one cluster fail, traffic flows to another cluster automatically. Teams can also prefer local backends and use remote ones only as a fallback, which keeps traffic close and costs low during normal times.

High availability across regions

A critical service runs in two regions. If one region has a problem, the global Service sends traffic to the healthy region without any change to the applications.

Shared services

A logging or authentication service runs once and is consumed by many clusters, avoiding duplicate operation and cost.

Gradual migration

During a move from an old cluster to a new one, Services can exist in both and traffic can be shifted slowly with the same identity-based policy applying throughout.

!
Requirements and Costs

Joined clusters need Pod address ranges that do not overlap, network paths between them, and careful trust arrangements. Traffic between regions also adds delay and may add data transfer charges, so use it deliberately.

Simple Analogy

Two schools that each run their own phone system can set up a shared directory so that teachers can call each other directly and a help desk number rings in whichever school is open. They are still separate schools, but they behave as one community when needed.

17Advanced Features Worth Knowing

A tour of capabilities that solve specific, practical problems.

Edge

BGP control plane

Lets the cluster announce Pod and Service addresses to the surrounding network using the standard routing protocol BGP, so data centre routers know how to reach them.

Edge

Load balancer address pools

Hands out external addresses to Services of type load balancer in clusters that have no cloud provider to do it, which is common on bare metal.

Egress

Egress gateway

Makes traffic leaving the cluster use a predictable source address, which matters when outside firewalls only allow known addresses.

Fairness

Bandwidth manager

Limits how fast individual Pods may send, so one noisy workload cannot swamp the network. It uses scheduling techniques that are efficient and friendly to latency.

Nodes

Host firewall

Applies policy to the nodes themselves, protecting services such as remote login and the kubelet using the same identity language.

Runtime

Tetragon

A sibling project that uses eBPF to observe and enforce what processes do inside containers, such as which files they open or programs they start.

When the extras pay off

On bare metal and in private data centres, the combination of BGP and load balancer address pools replaces separate load balancer products for many teams. For regulated industries, a predictable egress address and a host firewall address common audit requirements. For shared clusters with many tenants, bandwidth limits keep neighbours fair. Each feature is optional, and each deserves a short experiment before it goes into production.

NeedFeature to consider
Reach Pods from the data centre networkBGP control plane
External addresses on bare metalLoad balancer address pools
Stable source address for outside firewallsEgress gateway
Stop a noisy Pod from hogging bandwidthBandwidth manager
Protect the nodes themselvesHost firewall
Watch or restrict process behaviourTetragon
i
Read the Maturity Labels

Cilium documents which features are stable, beta or limited. Check that label for every feature you plan to rely on, since maturity changes from release to release.

18Performance and Scaling Considerations

Where eBPF helps most, and where you still need to do your homework.

eBPF networking is often described as faster than the older approach, and in many situations that is true. Understanding why helps you predict when it will matter for you and when it will not.

Why faster

Constant-time lookups

Hash tables replace long rule chains, so cost does not climb as Services and policies multiply.

Why faster

Fewer detours

Programs can redirect packets directly between interfaces and bypass parts of the normal networking path.

Why faster

Early decisions

Choosing a backend at connection time and dropping bad traffic at the network card avoid work further along.

Why smoother

Incremental updates

Changing one map entry beats rewriting thousands of rules, so Service churn causes fewer hiccups.

The places to be careful

Maps have fixed sizes. If the connection tracking table fills up, new connections may be dropped, and if the policy table is too small for the number of rules, some policies cannot be loaded. Cilium exposes how full the maps are, and operators should size them for peak load and alert well before they fill. Kernel version also matters: newer kernels unlock faster paths and more features, while older ones force fallbacks. Finally, layer seven inspection and encryption cost extra processing, and should be measured rather than assumed to be free.

FactorEffectWhat to do
Number of ServicesLarge gains over iptables as the count growsBenchmark at realistic scale
Kernel versionDecides which fast paths and features existStandardise on a recent supported kernel
Map capacityFull maps cause drops or failed policy loadsSize for peak and alert on pressure
Layer seven rulesTraffic passes through a proxyUse only where needed
EncryptionExtra processor work per packetMeasure throughput impact
Overlay modeSmall per-packet overhead and smaller packetsAdjust packet size or use native routing
Simple Analogy

A modern conveyor system moves parcels much faster than a clerk with a paper list, but only if its belts are long enough for the number of parcels. When the belts fill up, parcels pile up at the entrance. Good operators watch how full the belts are.

!
Benchmark Honestly

Published speed-ups come from specific tests. Your gains will depend on your own traffic. Test with realistic workloads before and after, and judge the change by the numbers you measure.

19Security of Cilium Itself

A powerful component deserves careful protection.

Cilium sits in a very privileged position. It loads programs into the kernel and controls the network of every Pod. That power is what makes it useful, and it is also why the security of Cilium itself deserves attention.

Privilege

The agent is privileged

It needs elevated rights to load eBPF programs and manage network interfaces. Anyone who can take control of the agent can alter networking on that node.

Safety net

The verifier

The kernel verifier ensures each program is safe before it runs, so a bug in a datapath program cannot crash the machine, even though it runs inside the kernel.

Access

Control over who can change policy

Policies are Kubernetes objects. Use role-based access control to decide who may create, edit or delete them, since a loose permission here can open the network.

Data

Protect Hubble

Use encrypted connections for Hubble and limit who may see which flows, as they reveal how services communicate.

Policy as code

Because policies are ordinary Kubernetes objects, teams can keep them in version control, review changes like code, test them in non-production clusters and roll them out with the same pipelines as applications. This turns network security from a pile of hand-edited rules into a reviewed and auditable history. A common pattern is a default-deny policy for each namespace, with explicit allow rules owned by the teams that understand their own traffic, and cluster-wide guardrails owned by a platform or security team.

RiskControl
Compromised agent or nodeHarden nodes, restrict who can run privileged workloads, keep Cilium updated
Unauthorised policy changesRole-based access control and review of policy changes
Lateral movement between PodsDefault-deny with narrow identity-based allows
Data exfiltration to the internetName-based outbound rules and egress controls
Exposure of flow dataEncrypted Hubble connections and scoped access
!
Keep Current

As with any widely used infrastructure software, security fixes are released over time. Follow the project’s release notes and plan regular, tested upgrades.

20Monitoring and Day-Two Operations

What to watch, how to upgrade and how to find the cause when something breaks.

Installing Cilium is the easy part. Running it well for years means watching a few key signals, upgrading carefully and having a calm troubleshooting routine.

SignalWhat it tells youHealthyWorrying
Agent health on every nodeWhether each node’s networking is managedAll agents readyAgents restarting or not ready
Dropped packet counters, by reasonPolicy denials and other dropsLow and explainedSudden spikes or unexplained reasons
Map pressureHow full eBPF tables areComfortably below capacityApproaching full
Endpoint statesWhether Pods are fully set upAlmost all readyMany stuck in setup
Hubble drop and DNS metricsPolicy and name resolution problems seen by workloadsStableRising drops or lookup failures
Policy computation timeHow long it takes to apply changesShort and steadyGrowing with label or policy churn

Upgrades

Upgrade Cilium the same careful way you would upgrade anything that carries all your traffic. Read the release notes for changes in defaults and removed features, test in a non-production cluster first, upgrade nodes gradually, and verify connectivity after each step. Because the kernel programs keep running while the agent restarts, well-planned upgrades are usually smooth, but surprises do happen, and a rehearsed rollback plan is worth having.

A calm troubleshooting routine

1

Check agent and endpoint health

Confirm the agent on the affected node is running and that the Pod’s endpoint is in a ready state.

2

Look at the flow

Use Hubble to find the failing connection and read its verdict and drop reason.

3

Compare identities and policy

Check which identities the two sides have and which policies select them, looking for a missing allow or an unexpected deny.

4

Check the plumbing

If policy looks right, look at Service backends, routing mode, map pressure and node-to-node connectivity.

5

Write it down

Record the cause and add an alert or a policy test so the same problem is caught earlier next time.

i
Connectivity Tests

Cilium ships a built-in connectivity test suite that exercises many paths in a running cluster. Running it after installs and upgrades is a cheap way to catch problems early.

21Best Practices and Design Patterns

Habits that experienced teams build into their Cilium clusters.

Practice 1

Standardise the kernel

Use a recent, supported kernel across all nodes so every feature behaves the same everywhere.

Practice 2

Plan address ranges up front

Choose non-overlapping Pod and node ranges with future growth and multi-cluster use in mind.

Practice 3

Default-deny per namespace

Start closed, then open only what each application needs, including DNS and required platform services.

Practice 4

Label with intent

Use a small, stable set of labels for identity, and keep high-churn labels out of the identity calculation.

Practice 5

Enable Hubble early

Turn on observability before problems appear, so you have history when you need it.

Practice 6

Use layer seven sparingly

Apply protocol-aware rules only where they add real value, keeping most traffic on the fast path.

Practice 7

Treat policy as code

Store, review, test and deploy policies through the same pipeline as applications.

Practice 8

Rehearse upgrades

Test every upgrade in a staging cluster and keep a rollback plan ready.

A safe rollout recipe for policy

1

Observe first

Use Hubble to learn which connections a workload really makes before writing any rule.

2

Write the allow rules

Translate the observed, legitimate flows into identity-based rules, including DNS.

3

Test outside production

Apply the policy in a test environment and replay normal traffic to confirm nothing breaks.

4

Roll out gradually

Enable one namespace or workload at a time while watching drop counters.

5

Keep watching

Alert on new drops, and review policies regularly as applications change.

22Common Mistakes and Anti-patterns

Five habits that often lead to trouble, and what to do instead.

ANTI-PATTERN-01 Avoid
Problem

A team installs Cilium on nodes with an old kernel and enables every feature, assuming all of them work.

Why It’s Harmful

Features that need newer kernels silently fall back or fail, leading to confusing gaps between the documentation and real behaviour.

Correct Approach

Check the required kernel for each feature, standardise on a supported kernel, and verify with the built-in connectivity tests.

ANTI-PATTERN-02 Avoid
Problem

A single narrow policy is applied to a busy namespace without planning for the others.

Why It’s Harmful

Selecting a Pod switches it to deny by default for that direction, so unrelated traffic, including DNS lookups, is suddenly blocked and causes an outage.

Correct Approach

Design the whole policy set for the namespace, include DNS and platform needs, and roll it out gradually while watching drops.

ANTI-PATTERN-03 Avoid
Problem

Every Pod carries a unique label, such as a build hash, and the label is counted as part of its identity.

Why It’s Harmful

The number of identities grows with the number of Pods, which wastes memory, slows policy calculation and weakens the whole idea of shared identity.

Correct Approach

Keep identity-relevant labels few and stable, and exclude high-churn labels from identity.

ANTI-PATTERN-04 Avoid
Problem

Operators ignore map sizes until connections start failing under peak load.

Why It’s Harmful

Full connection tracking or policy maps cause dropped connections or failed rule loads, usually at the worst possible time.

Correct Approach

Size maps for peak load, watch map pressure and alert early.

ANTI-PATTERN-05 Avoid
Problem

Layer seven rules are used everywhere, because they feel more precise.

Why It’s Harmful

All that traffic goes through the proxy, adding cost and delay, and the rules become hard to maintain and test.

Correct Approach

Use identity and port rules for most traffic, and add protocol-aware rules only for sensitive paths.

SymptomLikely causeFirst check
Everything breaks after a first policyPods switched to deny by default, DNS forgottenHubble drops with policy reason
New connections fail at peakConnection tracking table fullMap pressure metrics
Pods stuck startingAgent unhealthy or address pool exhaustedAgent status and address pool use
Odd large packets fail in overlayPacket size too big for tunnel overheadPacket size settings
Policy updates feel slowToo many identities or high label churnIdentity count and label choices

23Advantages, Disadvantages and Trade-offs

A balanced view before you commit.

Advantages

  • Fast, predictable service load balancing that scales with cluster size
  • Identity-based policy that survives Pod restarts and address changes
  • Rich policy, including protocol-aware and domain-name rules
  • Built-in observability through Hubble, drawn from the datapath itself
  • One platform for networking, security, observability, ingress and multi-cluster
  • Active community and broad industry adoption

Disadvantages / Trade-offs

  • Depends on recent Linux kernels for the best features
  • A large feature surface that takes time to learn well
  • Debugging kernel-level behaviour needs new skills
  • Fixed-size maps need planning and monitoring
  • Switching networking plugins on a live cluster is difficult
  • Some features are still maturing and change between releases

How it compares with other networking choices

OptionApproachStrengthWeakness
Simple overlay pluginsBasic connectivity without policyVery easy to runNo built-in policy or deep visibility
Cloud provider network pluginsPods use real cloud network addressesTight cloud integrationAddress limits and provider lock-in
iptables-based policy pluginsRules in netfilterMature, widely understoodRule lists grow with scale
Other plugins with an eBPF optionOptional eBPF datapathFamiliar tooling plus eBPF speedFeature sets and depth differ
CiliumeBPF datapath with identity at its heartBroad, integrated feature set and observabilityMore to learn and operate

The honest summary is that Cilium offers the most integrated eBPF-based networking story, but integration comes with a learning curve. Small clusters with simple needs may be perfectly happy with a simpler plugin. Large, security-sensitive or fast-changing clusters are where the extra capability pays for itself. Several other plugins also offer eBPF modes, so compare current features against your actual requirements rather than choosing by reputation.

“Cilium does not make the network simpler. It makes the network visible, identity-aware and fast enough that the complexity becomes manageable.”

24Real-World and Industry Examples

Where teams use these ideas in practice.

Managed Kubernetes offerings

Several cloud providers base the networking of some of their managed clusters on Cilium, taking advantage of the eBPF datapath, policy enforcement and built-in observability while hiding the setup work from customers.

Large clusters with many Services

Platforms with thousands of Services replace kube-proxy to avoid long rule chains and slow updates. They watch map pressure and use socket-level load balancing to cut per-packet work inside the cluster.

Regulated industries

Banks and healthcare providers use default-deny identity policy, name-based outbound rules, transparent encryption and flow logs from Hubble to show auditors exactly which services may talk and which did.

Bare metal and private data centres

Teams without a cloud load balancer use the BGP control plane and load balancer address pools to announce Service addresses to their routers, replacing separate load balancing hardware or software.

Multi-region resilience

Organisations connect clusters in several regions with Cluster Mesh and global Services, so a regional failure shifts traffic to healthy backends elsewhere without application changes.

Platform teams and shared clusters

Central teams set cluster-wide guardrail policies and bandwidth limits, while application teams own policies in their own namespaces, giving everyone freedom within safe boundaries.

i
Common Thread

Teams that succeed with Cilium tend to start small, switch on Hubble early, learn from real traffic, and add features one at a time as clear needs appear.

25Frequently Asked Questions

Short answers to questions beginners ask most often.

Q1What is eBPF in one sentence?

It is a way to run small, verified programs safely inside the Linux kernel, attached to events such as packet arrival, so that networking, security and observability can be done fast and without changing the kernel itself.

Q2Is Cilium a replacement for kube-proxy?

It can be. Cilium can handle Service load balancing with eBPF so that kube-proxy is not needed. This is optional, and it depends on kernel support and your preferences.

Q3Does Cilium work with standard Kubernetes network policies?

Yes. Cilium enforces the standard NetworkPolicy objects and also adds its own richer policy objects for features such as deny rules, protocol-aware rules and domain-name rules.

Q4Why does Cilium talk about identity instead of IP addresses?

Pod addresses change constantly, so rules based on addresses go stale. Identity comes from labels and stays the same for every Pod of an application, making policy stable and compact.

Q5Do I need a service mesh if I use Cilium?

Not necessarily. Cilium covers secure connectivity, policy, observability and ingress, and offers sidecar-free mesh features. If you need advanced traffic management that only a dedicated mesh provides, evaluate that mesh as well.

Q6What happens to traffic if the Cilium agent restarts?

Existing connectivity generally continues, because the eBPF programs and maps remain in the kernel. The agent reconnects to that state and reconciles it when it comes back.

Q7Can I add Cilium to a running cluster that uses another plugin?

It is possible with careful migration procedures, but it is delicate. Many teams prefer to adopt Cilium when building a new cluster and move workloads over gradually.

Q8Is Hubble required?

No, it is optional, but it is one of the most valuable parts of the platform, because it makes dropped traffic and policy problems easy to see.

Q9Does eBPF make my cluster less secure, since it runs in the kernel?

The kernel verifier checks every program for safety before it runs. The agent that loads programs is privileged, so it must be protected carefully, but the programs themselves are constrained by the verifier.

Q10Will Cilium always make my network faster?

Not always by a large amount. Benefits are biggest in large clusters with many Services and heavy churn. Smaller clusters may see little difference, so measure with your own workloads.

26Summary and Key Takeaways

Traditional Kubernetes networking leaned on long chains of firewall rules and on IP addresses that change every time a Pod moves. eBPF lets Cilium put small, verified programs directly inside the Linux kernel, where they can look up Services in hash tables, recognise workloads by label-based identity, enforce policy at layers three to seven, and report every flow to Hubble. The result is networking that scales more smoothly, security that survives churn, and visibility that turns long debugging sessions into short ones. The price is a dependence on modern kernels, a broad feature set to learn, and a few new operational habits such as sizing maps and watching drop reasons. Teams that start small, observe first and add features deliberately tend to get the most from it.

Key Takeaways

  • eBPF puts small safe programs in the kernel — they attach to hooks such as packet arrival, keep state in maps and are checked by a verifier before running.
  • Cilium is an eBPF-based CNI and more — it provides connectivity, kube-proxy replacement, network policy, encryption, observability, ingress and multi-cluster networking from one foundation.
  • Identity replaces addresses — labels become shared security identities, so policy stays small and stable no matter how often Pods restart or move.
  • Table lookups beat rule chains — Service load balancing through eBPF maps keeps lookup cost steady as the cluster grows, and socket-level translation removes per-packet rewriting inside the cluster.
  • Policy flips from open to closed once selected — plan namespace policies as a whole, remember DNS and platform traffic, and roll out gradually while watching drops.
  • Use heavier features deliberately — layer seven rules, encryption and sidecar-free mesh features add cost, so apply them where they clearly pay off.
  • Operate it with care — standardise kernels, size maps and alert on pressure, protect the privileged agent and Hubble data, treat policy as code and rehearse upgrades.