RousselTMLEARNING

Observability

Observing the Kubernetes network with Cilium Hubble

Make a Kubernetes cluster's network flows visible with Cilium Hubble: architecture, the hubble observe CLI, graphical interface, Prometheus metrics and diagnosing dropped packets.

1. Hubble in brief #

Cilium's observability layer.

Architecture #

Hubble architecture
Metrics are exposed by each agent; detailed flows go through Relay.

Cilium is an eBPF-based Kubernetes CNI. Since it sees every packet, it can also produce flows: who talks to whom, on which port, with which verdict (forwarded, dropped), and for HTTP, DNS or Kafka, the details of the request. Hubble exposes these flows.

2. Installing and observing #

The cilium and hubble CLIs.

Enabling #

cilium install
cilium status --wait
cilium hubble enable --ui
cilium hubble port-forward &      # Relay sur localhost:4245
hubble status
# ou avec Helm
helm upgrade cilium cilium/cilium -n kube-system --reuse-values \
  --set hubble.relay.enabled=true --set hubble.ui.enabled=true \
  --set hubble.metrics.enabled="{dns,drop,tcp,flow,port-distribution,httpV2}" 

hubble observe #

hubble observe --namespace boutique --follow
hubble observe --verdict DROPPED                      # paquets rejetés (network policies)
hubble observe --protocol dns --namespace boutique    # requêtes DNS
hubble observe --to-pod boutique/checkout --protocol http
hubble observe --from-label app=front -o json | jq '.flow.destination'
Good practice: hubble observe --verdict DROPPED is the first reflex when « service A can no longer reach service B » after adding a NetworkPolicy.

3. Interface and metrics #

Visualizing and alerting.

Hubble UI #

cilium hubble ui opens a map of a namespace's services, built from real flows, with the list of flows and their verdicts. Ideal for discovering the dependencies of an unfamiliar application.

Prometheus metrics #

MetricUsage
hubble_drop_totalDropped packets by reason (policy, error...)
hubble_dns_queries_total, hubble_dns_responses_totalDNS volume and errors (NXDOMAIN)
hubble_http_requests_totalHTTP requests by code (if L7 visibility is enabled)
hubble_tcp_flags_totalSYN, RST: refused connections
- alert: PolicyDrops
  expr: sum by (reason) (rate(hubble_drop_total{reason="POLICY_DENIED"}[5m])) > 1
  for: 10m
  labels: { severity: warning }

Related articles

eBPF explained: programs in the Linux kernel to observe without instrumenting

What eBPF is, how a program is verified and then run in the kernel, hook points (kprobes, uprobes, tracepoint…

Diagnosing with bpftrace and the bcc tools

Everyday eBPF diagnostic tools: bpftrace one-liners (system calls, files, latencies), bcc tools (execsnoop, o…

Zero-code instrumentation with Grafana Beyla (OpenTelemetry eBPF Instrumentation)

Get RED metrics and HTTP/gRPC traces from any application without changing it: Grafana Beyla and OpenTelemetr…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!