Why Cilium?
Cilium leverages eBPF (extended Berkeley Packet Filter) to provide networking capabilities directly in the Linux kernel:- Performance: No iptables overhead; packets processed at kernel level
- Observability: Real-time visibility into L3-L7 traffic flows
- Security: Identity-based network policies independent of IP addresses
- Scalability: Handles large-scale Kubernetes deployments efficiently
- Compatibility: Co-exists with Istio for combined L3/L4 + L7 capabilities
Cilium Installation
Cilium is installed via Helm with Istio-compatible settings:Key Configuration Options
| Setting | Value | Purpose |
|---|---|---|
ipam.mode | kubernetes | Use Kubernetes’ native IPAM for pod IPs |
cni.exclusive | false | Allow CNI plugin chaining with Istio |
socketLB.hostNamespaceOnly | true | Prevent interference with Istio traffic redirection |
kubeProxyReplacement | false | Use kube-proxy for safer Istio compatibility |
hubble.enabled | true | Enable Hubble observability |
hubble.ui.service.type | NodePort | Expose Hubble UI externally |
IPAM Configuration
Cilium uses Kubernetes-native IPAM mode:- Simpler integration with existing Kubernetes clusters
- No additional IPAM daemon required
- Compatible with
hostNetworkpods - Works seamlessly with Kind’s networking model
CNI Plugin Chaining
To support Istio ambient mode, Cilium is configured for CNI chaining:- Cilium CNI: Provides pod networking and eBPF datapath
- Istio CNI: Configures traffic redirection to ztunnel
Socket Load Balancing
Socket-level load balancing is restricted to host namespace:Hubble Observability
Hubble is Cilium’s observability platform, providing network and security visibility.Architecture
Components
Hubble Server (embedded in Cilium agent):- Collects flow data from eBPF maps
- Provides gRPC API for local node queries
- Stores recent flows in circular buffer
- Aggregates data from all Cilium agents
- Provides cluster-wide flow visibility
- Filters and correlates flows across nodes
- Web-based visualization of service map
- Real-time traffic flow display
- Protocol-aware (HTTP, DNS, Kafka, etc.)
- Accessible at
http://localhost:31235
Observability Features
Service Map
Hubble UI automatically generates a service dependency graph:- Nodes: Kubernetes services, pods, and external endpoints
- Edges: Network flows with protocol and status
- Filtering: By namespace, labels, verdicts (allowed/denied)
- Real-time updates: Live traffic visualization
Flow Logs
Hubble captures rich metadata for each network flow:- L3/L4: IP addresses, ports, protocols
- L7: HTTP methods, URLs, gRPC methods, DNS queries
- Identity: Pod names, namespaces, labels
- Verdict: Allowed, denied, redirected
- Timestamps: With microsecond precision
Using Hubble CLI
Thehubble CLI provides powerful flow inspection:
Hubble UI Access
Access the web interface athttp://localhost:31235 when running Cilium or Full mode.
Features:
- Interactive service map with zoom and pan
- Flow table with filtering and search
- Namespace selector for scoping view
- Protocol breakdown and statistics
- Export to JSON for analysis
Network Policies
Cilium extends Kubernetes NetworkPolicy with additional capabilities:Identity-Based Policies
Unlike traditional IP-based policies, Cilium uses security identities:- Works across node boundaries
- Survives pod rescheduling (IP changes)
- More intuitive than CIDR-based rules
- Scales to thousands of pods
L7 Protocol Policies
Cilium can filter based on application-layer protocols:- HTTP/1.1 and HTTP/2
- gRPC
- Kafka
- DNS
- Cassandra
DNS-Based Policies
Allow egress to external services by DNS name:eBPF Datapath
Cilium’s eBPF programs provide high-performance packet processing:Datapath Components
tc (Traffic Control) BPF:- Attached to network interfaces
- Handles ingress/egress packet processing
- Implements network policies and routing
- Performs connection tracking
- Processes packets before kernel stack
- Used for DDoS mitigation and load balancing
- Not enabled by default in this platform
- Intercepts socket operations (connect, bind, etc.)
- Implements socket-level load balancing
- Restricted to host namespace in this setup
Performance Benefits
Compared to iptables-based networking:- Lower latency: No packet copying to userspace
- Higher throughput: Kernel-level processing
- Better scalability: O(1) rule lookup vs. O(n) iptables chains
- Less CPU overhead: No context switches
- 50% lower latency for small packets
- 2-3x higher throughput for load balancing
- 70% lower CPU usage for connection tracking
Integration with Istio
Cilium and Istio complement each other:| Layer | Cilium | Istio |
|---|---|---|
| L3/L4 | eBPF-based routing and policies | Transparent mTLS encryption |
| L7 | Basic HTTP/gRPC filtering | Advanced traffic management (retries, circuit breaking) |
| Observability | Network flows and DNS | Distributed tracing and metrics |
| Security | Identity-based network policies | JWT authentication, authorization policies |
Traffic Flow with Both Enabled
Troubleshooting
Check Cilium Status
Diagnose Network Policy Issues
Hubble Not Working
CNI Plugin Issues
Next Steps
Service Mesh
Learn how Istio adds L7 capabilities on top of Cilium
Observability
Explore the full observability stack beyond network flows