In modern cloud-native environments, Kubernetes has become the de facto standard for container orchestration. However, as clusters scale and microservices proliferate, gaining clear visibility into network interactions becomes increasingly challenging. Traditional tools like tcpdump or Wireshark provide packet-level details but lack the contextual awareness of pods, services, and policies. Enter Cilium Hubble, an innovative observability platform that leverages eBPF technology to deliver granular, real-time insights into every network flow within your cluster.
Hubble transforms how DevOps teams troubleshoot connectivity issues, validate security policies, and optimize application performance. By capturing data directly from the kernel without performance degradation, it offers a holistic view of L3/L4 flows, Layer 7 protocols, DNS resolutions, and policy verdicts. This article dives deep into Hubble’s architecture, deployment strategies, advanced querying techniques, and integration best practices, empowering you to achieve full-stack network transparency.
Why Network Observability Matters in Kubernetes
Kubernetes abstracts infrastructure complexity, but this abstraction often obscures network behavior. Applications communicate across namespaces, services load-balance traffic, and network policies enforce segmentation—all happening invisibly beneath the surface. Without proper observability, issues like latency spikes, connection drops, or unauthorized access go undetected until they cascade into outages.
Hubble addresses these pain points by providing:
- Pod-level context: Every flow includes source/destination pod names, namespaces, and labels.
- Policy verdict tracking: See exactly why packets are allowed, denied, or redirected.
- L7 protocol awareness: Parse HTTP paths, gRPC methods, Kafka topics without app instrumentation.
- Service dependency graphs: Visualize communication patterns across your mesh.
- Zero-overhead monitoring: eBPF runs in-kernel, avoiding user-space bottlenecks.
According to official Cilium documentation, Hubble processes millions of flows per second across production clusters, proving its scalability for enterprise workloads.
The Power of eBPF in Cilium’s Data Plane
At Hubble’s core lies eBPF (extended Berkeley Packet Filter), a revolutionary Linux kernel technology that allows safe, programmable code execution at the packet processing stage. Cilium, as a CNI plugin, attaches eBPF programs to network interfaces, sockets, and tracepoints, capturing metadata richer than traditional sampling methods.
Here’s how the flow works:
- Event capture: eBPF hooks trigger on TCP/UDP connects, DNS queries, HTTP requests.
- Context enrichment: BPF maps correlate flows with Kubernetes metadata (pods, services, identities).
- Event emission: Traces and metrics queue into ring buffers.
- Aggregation: Cilium agents consume buffers and expose via gRPC.
This architecture ensures Hubble sees everything—from intra-node loops to cross-cluster traffic—while maintaining microsecond latencies.
Deploying Cilium and Enabling Hubble
Getting started requires a Kubernetes cluster (v1.21+) with kernel 4.19+ supporting eBPF. Use Helm for installation:
helm repo add cilium https://helm.cilium.io/helm install cilium cilium/cilium --version 1.17.4 \ --namespace kube-system \ --set hubble.enabled=true \ --set hubble.relay.enabled=true \ --set hubble.ui.enabled=trueVerify deployment:
cilium status --waitcilium hubble enable| Component | Purpose | Deployment Mode |
|---|---|---|
| Cilium Agent | eBPF dataplane + Hubble server | DaemonSet (per node) |
| Hubble Relay | Cluster-wide aggregation | Deployment (1-3 replicas) |
| Hubble UI | Web dashboard | Deployment (LoadBalancer) |
Port-forward the UI: kubectl port-forward -n kube-system svc/hubble-ui 8081:80 and access at http://localhost:8081.
Mastering Hubble CLI for Flow Investigation
The Hubble CLI (hubble observe) is your primary debugging weapon. It streams live flows with powerful filters.
Basic Flow Observation
# All recent flowshubble observe --last 10# Pod-specific traffichubble observe --pod my-app-abc123 --namespace prod --last 100# Protocol filteringhubble observe --protocol TCP --to-port 443 --verdict FORWARDEDAdvanced Queries and Pipelining
Combine with Unix tools for analysis:
# Service connectivity matrixhubble observe --namespace default --last 5000 --json | \ jq -r '.flow.source.pod_name + " -> " + .flow.destination.service_name' | \ sort | uniq -c | sort -nr# Detect drops by policyhubble observe --verdict DROPPED --to-fqdn google.com -fJSON output enables scripting: parse for anomalies, feed to ELK, or trigger alerts.
Visualizing Dependencies with Service Maps
Hubble UI renders interactive graphs showing service-to-service communication. Key views include:
- Traffic Map: Directed edges sized by byte volume, colored by protocol.
- Topology View: Namespace hierarchies with drill-down.
- Timeline Scrubber: Replay flows over time to correlate with deployments.
Export maps as SVG or integrate with Grafana for dashboards combining flows, metrics, and traces.
Troubleshooting Common Scenarios
Policy Debugging
Test a restrictive egress policy:
cat <<EOF | kubectl apply -f -apiVersion: cilium.io/v2kind: CiliumNetworkPolicymetadata: name: restrict-externalspec: endpointSelector: matchLabels: app: web egress: - toCIDR: - 10.0.0.0/8EOFhubble observe --verdict DROPPED --pod web-* --followExec into pod and curl external sites—watch denials in real-time.
Latency Hotspots
# TCP retransmits and resetshubble observe --json | jq 'select(.flow.l4.tcpFlags & (1<<4 | 1<<0))'# Slow DNShubble observe --dns --json | jq '.flow.l7.dns | select(.rdt > 1000000)' # >1sL7 Protocol Analysis
Enable HTTP observability: cilium hubble enable-l7
hubble observe --http --json | \ jq '{path: .flow.l7.http.path, status: .flow.l7.http.status, pod: .flow.source.pod_name}'Integrating with Observability Ecosystem
Hubble exports metrics to Prometheus:
--set hubble.metrics.enabled="{dns:followDNS=true,drop,tcp,flow,http,port-distribution}"Grafana dashboards visualize:
- Flow volume by namespace/service
- Drop rates and top policy violators
- HTTP error ratios per endpoint
For traces, Hubble emits OpenTelemetry spans compatible with Jaeger/Zipkin.
Performance and Scaling Considerations
Hubble’s efficiency stems from eBPF, but large clusters need tuning:
- Relay sharding: Multiple relays for >100 nodes.
- Sampling:
--sample-flowsfor high-volume namespaces. - Retention: Configure buffer sizes via ConfigMap.
- L7 opt-in: Disable globally, enable per-namespace.
Production benchmarks show <1% CPU overhead at 10Gbps/node.
Security Use Cases Beyond Observability
Hubble enforces zero-trust by logging all policy decisions, enabling audits like:
- Detect shadow connections bypassing policies
- Baseline normal traffic for anomaly detection
- Forensic analysis post-breach
Integrate with Falco for runtime security on network events.
FAQ
What kernel versions support Hubble?
Linux 5.3+ for full features; 4.19+ minimum.
Can Hubble work without Cilium as CNI?
Yes, in chaining mode with other CNIs like Calico.
Is Hubble suitable for multi-cluster?
Absolutely—Hubble Relay supports federation across clusters.
How does Hubble compare to Istio?
Hubble offers deeper L3/L4 visibility without sidecar proxy overhead.
Best Practices Summary
- Start broad, filter surgically
- Automate JSON parsing for alerts
- Combine with logs/traces for full context
- Review drops weekly for policy gaps
- Scale Relay horizontally
Cilium Hubble redefines Kubernetes networking by making the invisible visible. From rapid incident response to proactive optimization, its eBPF foundation delivers unmatched depth without complexity.
References
- Cilium Documentation: Hubble Observability — Cilium Project. 2024-08-14. https://docs.cilium.io/en/stable/observability/hubble/
- Hubble for Network Observability and Security (Part 1) — Cilium.io. 2024-08-14. https://cilium.io/blog/2024/08/14/hubble-for-network-security-and-observability-part-1/
- eBPF Applications Landscape — eBPF Foundation. 2025-03-15. https://ebpf.io/applications/
- Cilium Helm Chart Reference — Cilium Project. 2026-04-20. https://docs.cilium.io/en/stable/charts/
- Kubernetes Network Policy Documentation — Kubernetes.io. 2026-01-10. https://kubernetes.io/docs/concepts/services-networking/network-policies/

