Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Cilium: eBPF Networking for Kubernetes

By Kokil Thapa | Last reviewed: September 2026

Cilium: eBPF Networking for Kubernetes is the CNI I reach for when a cluster needs more than basic pod connectivity. Traditional CNIs lean on iptables chains that grow with every Service and every rule. Cilium pushes policy and load balancing into eBPF programs attached at the kernel level. That shift cuts per-packet overhead and gives you identity-based security that scales better on busy nodes. If you already run Kubernetes for Laravel workloads on Kubernetes or multi-tenant SaaS, this guide walks through architecture, install, policy, and the production mistakes I see repeatedly.

What is Cilium and how does eBPF networking work in Kubernetes?

Cilium is a cloud-native CNI built around extended Berkeley Packet Filter (eBPF). Instead of programming thousands of iptables rules on every node, Cilium loads verified eBPF bytecode into the Linux kernel. Those programs handle routing, NAT, policy enforcement, and observability hooks at attach points like TC (Traffic Control) and XDP.

Each Kubernetes node runs a cilium-agent DaemonSet. The agent watches the Kubernetes API and Cilium CRDs. It compiles policy into eBPF maps that the kernel reads on every relevant packet. Pod identity comes from labels, not only IP addresses. That model aligns well with how Kubernetes network policies are written in the real world.

The control plane has two extra pieces beyond a typical CNI. The Cilium Operator manages cluster-wide resources like CiliumNode configs and IPAM modes. Hubble—optional but valuable—collects flow logs and service dependency maps from eBPF tracepoints. For deeper runtime security on the same stack, pair this with Tetragon runtime security with eBPF or compare against Falco runtime security depending on your threat model.

Cilium eBPF ArchitectureKubernetes APIPods, Services, NPCilium OperatorCluster CRDsCilium AgentPer-node DaemonSetHubble RelayFlow observabilityLinux Kernel — eBPF ProgramsTC / XDPPolicy MapsLB / NATTrace
Cilium eBPF networking for Kubernetes — control plane agents compile policy into kernel programs on each node

Why eBPF beats iptables at scale

iptables was never designed for dynamic microservice topologies. Every Service endpoint adds rules. Every network policy multiplies chains. On nodes running hundreds of pods, rule evaluation cost shows up as CPU spikes and latency jitter. eBPF programs run as compiled bytecode with map lookups—typically O(1) for policy decisions.

Kernel support matters. Cilium targets Linux 5.10 or newer for full feature coverage. Ubuntu 22.04 and 24.04 nodes on production clusters usually satisfy this. Verify with uname -r before you schedule a migration window. The official Cilium documentation lists minimum kernel features per release.

Cilium also supports several IPAM modes: cluster-pool, Kubernetes host-scope, ENI mode on AWS, and Azure IPAM. Pick the mode that matches your cloud or bare-metal layout. Wrong IPAM choice is a top cause of IP exhaustion on bare-metal Kubernetes with MetalLB clusters I have debugged.

How do you install Cilium on a Kubernetes cluster?

Install Cilium after the control plane is up but before you deploy application workloads. If another CNI is already active, plan a maintenance window. Switching CNIs in place is possible but messy. Greenfield clusters are straightforward.

  1. Confirm kernel version 5.10+ and disable or remove the existing CNI if present.
  2. Install the Cilium CLI on your admin workstation.
  3. Deploy Cilium via Helm or cilium install with values tuned to your environment.
  4. Enable kube-proxy replacement if you want full eBPF service load balancing.
  5. Validate with cilium status and a test pod ping across nodes.
  6. Optionally enable Hubble for flow visibility.

Cilium CLI install (typical greenfield path)

# Install Cilium CLI (Linux amd64 example)
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
curl -L --fail -o cilium.tar.gz \
  "https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-amd64.tar.gz"
sudo tar -C /usr/local/bin -xzf cilium.tar.gz cilium
rm cilium.tar.gz

# Install Cilium into the cluster
cilium install --version 1.16 \
  --set kubeProxyReplacement=true \
  --set k8sServiceHost=${API_SERVER_IP} \
  --set k8sServicePort=6443

# Verify
cilium status --wait
cilium connectivity test

Helm install for GitOps teams

Teams using Argo CD GitOps for Kubernetes usually prefer Helm. Add the Cilium repo, pin a chart version, and store values in Git.

helm repo add cilium https://helm.cilium.io/
helm repo update

helm upgrade --install cilium cilium/cilium \
  --namespace kube-system \
  --version 1.16.0 \
  --set operator.replicas=2 \
  --set kubeProxyReplacement=true \
  --set hubble.enabled=true \
  --set hubble.relay.enabled=true \
  --set hubble.ui.enabled=true

After install, confirm pod CIDR allocation and that CoreDNS resolves across nodes. A failed connectivity test often traces back to MTU mismatch on overlay tunnels or a firewall blocking VXLAN/Geneve between nodes. That pattern shows up on self-managed clusters deployed with Kubespray as often as on managed offerings.

Cilium Install WorkflowCheck kernel5.10+Remove old CNIIf neededHelm / CLIDeploy agentEnable HubbleOptionalcilium status --waitAll agents ready, kube-proxy replacement activeconnectivity testPod-to-pod, DNS, SNATDeploy workloadsApply policies next
Install Cilium, wait for agent readiness, then run connectivity tests before production traffic

How does Cilium compare to Calico and other Kubernetes CNI plugins?

Not every cluster needs Cilium. Small K3s edge clusters with a handful of services may run fine on Flannel. The switch pays off when you need L7 policy, deep observability, or kube-proxy replacement at scale.

CriteriaCilium (eBPF)CalicoFlannelCilium + Envoy (L7)
Data planeeBPF in kerneliptables or eBPF (optional)VXLAN overlayeBPF + Envoy sidecar
L3/L4 network policyYes, identity-awareYesNo native policyYes
L7 HTTP policyYes (Envoy or CRD)LimitedNoFull HTTP/gRPC rules
kube-proxy replacementNative eBPF LBPartial via eBPF dataplaneNoSame as Cilium
ObservabilityHubble flows + metricsFlow logs (add-ons)MinimalHubble + L7 logs
Operational complexityModerateModerateLowHigher
Best fitLarge clusters, zero-trust, observabilityMulti-cloud, familiar opsDev/test, simple edgeService mesh lite without full Istio

Calico remains a solid choice when teams already know its CRDs and BGP peering model. Cilium wins when you want one stack for CNI, service load balancing, and flow-level debugging without bolting on five add-ons. For enterprise application platforms with strict east-west segmentation, Cilium's label-based identity model reduces the IP-churn pain you get after horizontal pod autoscaling events.

eBPF Packet FlowSource Podapp: apiveth paircilium_hosteBPF TC hookPolicy checkeBPF LB mapService VIPDecision outcomesDROP — deny policyFORWARD — allowHubble records flow metadata
Cilium eBPF networking evaluates policy and service load balancing before packets leave the node

How do you configure network policies and observability with Cilium?

Standard Kubernetes NetworkPolicy objects work on Cilium. Cilium extends them with CiliumNetworkPolicy CRDs that add DNS-aware rules, HTTP path matching, and entity selectors like world or host.

Example: L4 policy between namespaces

apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  name: allow-frontend-to-api
  namespace: production
spec:
  endpointSelector:
    matchLabels:
      app: api
  ingress:
  - fromEndpoints:
    - matchLabels:
        app: frontend
        io.kubernetes.pod.namespace: production
    toPorts:
    - ports:
      - port: "8080"
        protocol: TCP

Example: L7 HTTP policy

apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  name: api-l7-allow
  namespace: production
spec:
  endpointSelector:
    matchLabels:
      app: api
  ingress:
  - fromEndpoints:
    - matchLabels:
        app: frontend
    toPorts:
    - ports:
      - port: "8080"
        protocol: TCP
      rules:
        http:
        - method: GET
          path: /api/v1/.*

Validate policies with cilium policy get and Hubble. Hubble UI shows allowed and denied flows in near real time. That beats tcpdump on a busy node when you are chasing a CrashLoopBackOff caused by network timeouts.

# Port-forward Hubble UI locally
kubectl port-forward -n kube-system svc/hubble-ui 12000:80

# Watch flows from CLI
hubble observe --namespace production --pod api \
  --verdict DROPPED

Export Hubble metrics to Prometheus for dashboards alongside Kubernetes performance tuning work. Flow drops correlated with latency spikes often reveal a missing egress rule to an external payment API—a pattern I have seen on production eCommerce stacks similar to Quick And Easy Nepalese Grocery.

When debugging JSON payloads returned from internal APIs during policy testing, a local JSON formatter keeps inspection readable without sending sensitive data to third-party sites.

What production gotchas should you plan for with Cilium on Kubernetes?

Cilium is stable on well-provisioned Linux nodes. Most outages I have traced come from environment mismatch, not from Cilium itself. Plan for these before you cut over production traffic.

  • Kernel and BPF filesystem: Ensure bpffs is mounted at /sys/fs/bpf. Some minimal node images skip this.
  • kube-proxy coexistence: Running kube-proxy alongside full kube-proxy replacement causes duplicate NAT rules. Pick one model and document it.
  • MTU and tunnel overhead: Geneve/VXLAN adds bytes. Set pod network MTU below the physical NIC MTU minus overhead or you get silent TCP hangs.
  • Node-local DNS cache: Policy must allow DNS to kube-dns or NodeLocal DNSCache endpoints. Deny-by-default namespaces break resolution first.
  • Upgrade ordering: Upgrade Cilium agents before Kubernetes minor version jumps. Check the release compatibility matrix each cycle.
  • Resource requests: Cilium agents use more memory than Flannel. Budget 500Mi–1Gi per agent on dense nodes.

Understand the broader node layout from Kubernetes worker node architecture and control-plane dependencies in Kubernetes architecture explained. That context speeds up triage when agents fail health checks after a kernel upgrade handled by your Linux system administration team.

Production GotchasMTU too highSilent packet loss on large responsesDual kube-proxyDuplicate service NAT rulesDNS blockedDefault-deny without kube-dns allowOld kernelMissing BPF features on node imageFix: cilium connectivity test + Hubble DROP flowsValidate before every production cutover
Most Cilium eBPF networking for Kubernetes outages trace to MTU, kube-proxy overlap, or DNS policy gaps

Encryption and multi-cluster considerations

Cilium supports WireGuard-based transparent encryption between nodes. Enable it when traffic crosses untrusted L3 networks. For multi-cluster service discovery, Cilium Cluster Mesh links multiple Kubernetes clusters with global services. That is advanced ops. Start single-cluster, master policy and Hubble, then expand.

The eBPF ecosystem continues to mature. The eBPF project site tracks kernel features and tooling. Kubernetes networking fundamentals remain documented in the Kubernetes networking guide. Cross-reference both when you design upgrades.

When should you choose Cilium eBPF networking for Kubernetes?

Choose Cilium when observability and policy matter as much as connectivity. High-churn microservice clusters, regulated workloads, and platforms running service mesh features without a full Istio footprint are strong fits. Skip it when you operate a two-node lab and just need pods to ping each other—Flannel or the built-in K3s CNI is enough.

On booking and CRM platforms like Adventure Third Pole Trek, predictable east-west latency matters during checkout and supplier API calls. Cilium's eBPF load balancing removes kube-proxy iptables overhead that grows with Service count. Pair that with sensible resource limits and requests so network improvements are not wasted on CPU-starved pods.

Budget for learning curve time. Your platform team needs comfort with CiliumNetworkPolicy, Hubble, and agent upgrades. Ongoing support and maintenance should include a quarterly Cilium version review alongside Kubernetes patch cycles.

Choose Cilium?Need L7 policy?Yes → CiliumNo → next checkCalico may suffice100+ pods per node?Yes → Cilium LBNo → simpler CNIFlannel / K3s default
Decision guide for adopting Cilium eBPF networking for Kubernetes versus lighter CNIs

If you run containerised apps without Kubernetes yet, read Docker networking and volumes explained first. The concepts transfer directly. For broader platform context, see my work on production web systems since 2010 and related Kubernetes guides.

Key Takeaways

  • Cilium replaces iptables-heavy CNIs with kernel eBPF for faster policy enforcement and optional kube-proxy-free service load balancing.
  • Install via Cilium CLI or Helm after confirming Linux 5.10+, then run cilium connectivity test before production cutover.
  • Use CiliumNetworkPolicy for L7 HTTP rules and DNS-aware egress controls beyond standard NetworkPolicy.
  • Enable Hubble early—flow-level DROP visibility saves hours compared to blind tcpdump sessions.
  • Watch MTU, kube-proxy overlap, and DNS allow rules; they cause most first-week production incidents.
  • Choose Cilium for scale, zero-trust segmentation, and observability—not for minimal two-node lab clusters.

People Also Ask

Does Cilium replace kube-proxy in Kubernetes?

Yes, when you enable kube-proxy replacement during install. Cilium programs eBPF maps to handle ClusterIP, NodePort, and LoadBalancer forwarding without iptables rules from kube-proxy. You should disable or remove kube-proxy to avoid conflicting NAT behaviour.

What kernel version does Cilium require?

Cilium targets Linux 5.10 or newer for the full eBPF feature set including efficient kube-proxy replacement and advanced policy modes. Older kernels may work with reduced features. Always check the release notes for your chosen Cilium version before upgrading production nodes.

How is Cilium different from a service mesh like Istio?

Cilium operates at the CNI and node network layer using eBPF. It can enforce L7 HTTP policy without a full sidecar mesh, but it does not replace all Istio traffic management features like weighted canaries or rich mutual-TLS identity federation. Many teams use Cilium as the data plane and add a mesh only where advanced traffic shaping is required.

Can you run Cilium on managed Kubernetes like EKS or GKE?

Yes. EKS supports Cilium as an alternative CNI with the correct node configuration and IAM/network prerequisites. GKE Dataplane V2 is built on Cilium eBPF technology. Managed offerings reduce install friction but you still own policy design, upgrades, and observability integration.

Ship faster pod networking with the right CNI choice

Cilium: eBPF Networking for Kubernetes earns its place when policy, performance, and visibility cannot be afterthoughts. Start with a staging cluster, enable Hubble, write deny-by-default policies incrementally, and validate every change with connectivity tests. The payoff is lower node CPU overhead, clearer security boundaries, and flow logs that actually explain why a pod cannot reach its database.

Need help designing a production Kubernetes platform or migrating from a legacy CNI? Contact us to discuss architecture, install, and ongoing cluster operations.

Frequently Asked Questions

Cilium is a cloud-native CNI that loads verified eBPF programs into the Linux kernel instead of chaining thousands of iptables rules. Each node runs a cilium-agent DaemonSet that watches the Kubernetes API and Cilium CRDs, compiling policy into eBPF maps the kernel evaluates on every relevant packet. Pod identity comes from labels, not only IPs, which aligns with how NetworkPolicy is written in production.

Install after the control plane is up but before application workloads, and plan a maintenance window if another CNI is already active. Confirm Linux kernel 5.10+ with uname -r, install the Cilium CLI on your admin workstation, then deploy via cilium install or Helm with values tuned to your environment. Enable kubeProxyReplacement if you want eBPF service load balancing. Validate with cilium status --wait and cilium connectivity test. GitOps teams often pin chart version 1.16.0 in Git and deploy through Argo CD.

Yes, when kubeProxyReplacement is enabled at install. Cilium handles ClusterIP, NodePort, and LoadBalancer forwarding via eBPF maps. Disable or remove kube-proxy to avoid duplicate NAT rules.

Linux 5.10 or newer for full eBPF coverage, including efficient kube-proxy replacement and advanced policy modes. Ubuntu 22.04 and 24.04 nodes usually qualify. Older kernels may work with reduced features.

Flannel suits simple dev, test, or small K3s edge clusters with minimal policy needs. Calico remains solid for teams comfortable with its CRDs and BGP peering model, offering L3/L4 policy via iptables or optional eBPF. Cilium wins when you want identity-aware L3–L7 policy, native kube-proxy replacement, and Hubble flow visibility in one stack without bolting on multiple add-ons. Cilium plus Envoy adds full HTTP and gRPC L7 rules but increases operational complexity. Pick Cilium for large clusters, zero-trust segmentation, and observability—not for a two-node lab that only needs pods to ping.

Choose Cilium when observability and policy matter as much as connectivity. High-churn microservice clusters, regulated workloads, and platforms that need service-mesh-style L7 controls without full Istio are strong fits. On booking platforms like Adventure Third Pole Trek, predictable east-west latency during checkout and supplier API calls makes eBPF load balancing worthwhile because it removes kube-proxy iptables overhead that grows with Service count. Skip Cilium for minimal lab clusters where Flannel or the built-in K3s CNI is enough. Budget learning-curve time for CiliumNetworkPolicy, Hubble, and quarterly version reviews alongside Kubernetes patch cycles.

Standard Kubernetes NetworkPolicy objects work on Cilium. For more control, use CiliumNetworkPolicy CRDs with DNS-aware egress rules, HTTP path matching, and entity selectors like world or host. An L4 example allows frontend pods in production to reach api pods on TCP 8080. An L7 example restricts that traffic to GET requests matching /api/v1/.*. Validate with cilium policy get and Hubble UI, which shows allowed and denied flows in near real time—far faster than tcpdump on a busy node when chasing network timeouts behind a CrashLoopBackOff.

Hubble is Cilium's optional observability layer. It collects flow logs and service dependency maps from eBPF tracepoints, giving near-real-time visibility into allowed and dropped traffic. Enable it during install with hubble.enabled, hubble.relay.enabled, and hubble.ui.enabled in Helm, or the equivalent CLI flags. Port-forward hubble-ui to inspect flows, or run hubble observe with --verdict DROPPED to catch policy denials. Export Hubble metrics to Prometheus for dashboards. Flow drops correlated with latency spikes often reveal a missing egress rule to an external payment API—a pattern I have seen on production eCommerce stacks.

Cilium operates at the CNI and node network layer using eBPF. It can enforce L7 HTTP policy through Envoy or CRD-based rules without deploying a full sidecar mesh on every pod. It does not replace all Istio traffic-management features such as weighted canaries or rich mutual-TLS identity federation. Many teams use Cilium as the data plane and add a dedicated mesh only where advanced traffic shaping is required. Cilium plus Envoy covers service-mesh-lite HTTP and gRPC rules while keeping the core dataplane in the kernel.

Yes. EKS supports Cilium as an alternative CNI when nodes meet the correct configuration and IAM or network prerequisites. GKE Dataplane V2 is built on Cilium eBPF technology. Managed offerings reduce install friction, but you still own policy design, upgrades, and observability integration. The same production checks apply: confirm kernel 5.10+, run cilium connectivity test after install, and verify CoreDNS resolves across nodes before cutting over application traffic.

Cilium supports cluster-pool, Kubernetes host-scope, ENI mode on AWS, and Azure IPAM. The right choice depends on your cloud or bare-metal layout—not on Cilium defaults alone. Wrong IPAM selection is a top cause of IP exhaustion on bare-metal Kubernetes clusters using MetalLB that I have debugged. After install, confirm pod CIDR allocation and that test pods receive addresses before scheduling production workloads. Revisit IPAM when you expand node pools or change cloud networking topology.

Most incidents trace to environment mismatch, not Cilium itself. Ensure bpffs is mounted at /sys/fs/bpf on minimal node images. Do not run kube-proxy alongside full kube-proxy replacement—pick one model. Set pod network MTU below physical NIC MTU minus Geneve or VXLAN overhead or you get silent TCP hangs. Deny-by-default namespaces break DNS first; allow traffic to kube-dns or NodeLocal DNSCache endpoints. Upgrade Cilium agents before Kubernetes minor version jumps and check the release compatibility matrix each cycle.

Start with cilium status --wait and cilium connectivity test. A failed test often traces to MTU mismatch on overlay tunnels or a firewall blocking VXLAN or Geneve between nodes—a pattern I see on Kubespray-managed clusters as often as on managed offerings. Confirm CoreDNS resolves across nodes and test pod ping between nodes. Use Hubble to inspect DROPPED flows when policies are involved. If agents fail health checks after a kernel upgrade, verify Linux 5.10+ support and that bpffs is mounted before blaming application code.

Cilium supports WireGuard-based transparent encryption between nodes when traffic crosses untrusted L3 networks. Enable it when east-west traffic leaves a trusted segment. For multi-cluster service discovery, Cilium Cluster Mesh links multiple Kubernetes clusters with global services. That is advanced operations—start single-cluster, master policy and Hubble, then expand. Cross-reference the Cilium release compatibility matrix and Kubernetes networking guide when planning upgrades across linked clusters.

Cilium agents use more memory than Flannel. Budget 500Mi to 1Gi per agent on dense nodes running hundreds of pods. Your platform team needs comfort with CiliumNetworkPolicy, Hubble, and agent upgrades before production cutover. Include a quarterly Cilium version review alongside Kubernetes patch cycles in ongoing support plans. Pair network improvements with sensible pod resource limits and requests so CPU-starved application pods do not waste the latency gains eBPF load balancing provides on busy worker nodes.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: