Cilium Explained: eBPF-Powered Kubernetes Networking, Security and Observability

How Cilium uses eBPF as a Kubernetes CNI: replacing kube-proxy, identity-based network policies, L7 policies, Hubble flow visibility and service mesh feature...

Published December 4, 2026

Cilium is a Kubernetes networking plugin (CNI) built on eBPF. It handles pod networking, load balancing for Services, network policies, encryption and deep flow visibility, often replacing kube-proxy and its long iptables chains. Several managed Kubernetes offerings now use Cilium as their default or recommended dataplane.

The concept

Traditional kube-proxy implements Services with iptables or IPVS rules on each node; with thousands of Services, rule updates and packet traversal get slow. Cilium implements Service load balancing with eBPF hash-map lookups, which scale much better, and can run in kube-proxy replacement mode.

Instead of filtering by IP address, Cilium assigns security identities based on pod labels and enforces policies on identities, which stays correct as pods churn and IPs change. It supports standard Kubernetes NetworkPolicies plus its own CiliumNetworkPolicy with L7 rules (HTTP methods and paths, DNS names, Kafka topics). Hubble, Cilium's observability layer, shows every flow, which policy allowed or dropped it, and service dependency maps.

Architecture

Podslabels → security identitiesCilium agent (per node)programs eBPF, manages identitieseBPF datapathrouting, LB, policy, encryptionHubbleflow logs, metrics, service mapLinux kernel
Cilium components on each node.

What Cilium adds

Featurekube-proxy + basic CNICilium
Service load balancingiptables/IPVSeBPF maps (kube-proxy replacement)
Policy basisIP addressesLabel-based identities
L7 policies (HTTP, DNS)NoYes (CiliumNetworkPolicy)
Flow visibilityLimitedHubble flows and service maps
Transparent encryptionSeparate toolingWireGuard or IPsec built in

L7 policy in action

frontend podCilium eBPFapi podGET /adminL7 policy: only GET /api/*403 / drop (logged in Hubble)GET /api/ordersallowed
An L7-aware policy decision.

Practical examples

Install with the Cilium CLI

Then check status and connectivity.

cilium install --set kubeProxyReplacement=true
cilium status --wait
cilium connectivity test

An L7 HTTP policy

Allow only specific methods and paths from frontend to api.

apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata: { name: api-l7, namespace: shop }
spec:
  endpointSelector: { matchLabels: { app: api } }
  ingress:
    - fromEndpoints: [{ matchLabels: { app: frontend } }]
      toPorts:
        - ports: [{ port: "8080", protocol: TCP }]
          rules:
            http:
              - { method: GET, path: "/api/.*" }

Watch flows with Hubble

See drops and the reason in real time.

cilium hubble enable --ui
hubble observe --namespace shop --verdict DROPPED --follow

Common mistakes

  • Enabling kube-proxy replacement without checking kernel and environment requirements.
  • Mixing Cilium-specific policies and standard NetworkPolicies without understanding precedence.
  • Not enabling Hubble, missing the main debugging benefit.
  • Assuming L7 policies are free; they route traffic through a proxy for inspection.

Key takeaways

  • Cilium is an eBPF-based CNI for networking, security and observability.
  • eBPF load balancing scales better than iptables.
  • Identity-based and L7 policies give finer, more stable control.
  • Hubble provides flow-level visibility for debugging.

FAQ

Do I need a service mesh if I use Cilium?

Cilium offers mTLS, L7 policies and observability that cover some mesh use cases; full meshes still add advanced traffic management features.

Can I migrate an existing cluster to Cilium?

Yes, but CNI migrations need careful planning; many teams start with new clusters or node pools.

Is Cilium only for Kubernetes?

It is primarily used with Kubernetes, though parts (like load balancing) can run elsewhere.

More DevOps articles