MHRubel
HomeAboutProjectsSkillsExperienceBlogPhotosContact
MHRubel

Senior Software Engineer crafting high-performance web applications and SaaS platforms.

Navigation

  • Home
  • About
  • Projects
  • Skills
  • Experience
  • Blog
  • Photos
  • Contact

Get in Touch

Available for senior/lead roles and consulting.

bd.mhrubel@gmail.comHire Me

© 2026 Mahamudul Hasan Rubel. All rights reserved.

Built with using Next.js 16 & Tailwind v4

Back to Blog
KubernetesNetworkingSecurityJune 19, 20264 min read

Kubernetes Network Policies Debugging with Cilium Hubble

Master Kubernetes network policies using Cilium Hubble. Learn to use eBPF for deep network observability and fix silent traffic drops in your clusters.

KubernetesCiliumeBPFNetworkingObservabilityDevOps
Focused view of a computer screen displaying code and debug information.

During our Q3 infrastructure migration, we hit a wall. A critical service in our production cluster suddenly stopped talking to our PostgreSQL instance. The metrics showed a clean 5xx error rate, but the logs were suspiciously quiet. We spent roughly 4 hours digging through standard iptables logs before realizing the issue wasn't the application—it was an overly aggressive network policy we’d applied hours earlier.

If you've been working with Kubernetes network policies, you know the pain of "black box" connectivity. You apply a YAML manifest, and either it works, or the traffic vanishes into the ether. That’s where eBPF-powered tools change the game.

Debugging with Cilium Hubble and eBPF

We rely on Cilium Hubble for deep network observability. Unlike traditional tools that rely on sidecars or kernel-level packet capturing that can crush your CPU, Hubble hooks directly into the kernel via eBPF. This allows us to see exactly where a packet is dropped—whether it’s a policy rejection, a connection reset, or an invalid handshake.

When we hit this issue, I didn't reach for tcpdump. Instead, I fired up the Hubble CLI:

Bash
# Observe traffic for the specific namespace
hubble observe --namespace backend-prod --pod service-a --follow

The output was immediate. I saw a stream of "Policy Denied" events. Hubble didn't just tell me the traffic was blocked; it showed me the exact rule ID that triggered the drop.

Why our first attempt failed

We initially tried to "fix" it by widening the CIDR range in our CiliumNetworkPolicy. That was a mistake. It didn't solve the core issue; it just masked the problem while creating a massive security hole. We were essentially using a sledgehammer when we needed a scalpel.

After that failed, we realized we needed to understand Kubernetes networking at the identity level. We moved from IP-based rules to label-based selectors, which allowed us to permit traffic based on the application identity rather than the ephemeral pod IP.

Implementation Steps

To get this level of visibility, ensure you have Hubble enabled in your Cilium installation. If you’re running Cilium 1.14+, the commands are straightforward:

  1. Enable Hubble Relay:

    Bash
    helm upgrade cilium cilium/cilium --namespace kube-system \
      --set hubble.relay.enabled=true \
      --set hubble.ui.enabled=true
  2. Access the UI: Port-forwarding the UI makes visualizing these flows much easier than parsing terminal output:

    Bash
    cilium hubble ui
  3. Verify Policy Drops: Keep an eye on the verdict field in the Hubble output. A DROPPED verdict with a Policy reason is your smoking gun.

The Reality of Network Observability

Intricate abstract visualization of digital circuit blocks with vibrant LED lights, showcasing technology and innovation.

Using eBPF for Kubernetes security debugging is powerful, but it’s not magic. It generates a massive amount of data. In our cluster, we saw around 450 events per second during peak load. If you don't have a strategy for log aggregation—like Kubernetes logging—you’ll burn through your storage in hours.

We eventually narrowed the drop down to a missing toPorts definition in our policy. The service was trying to reach the DB on port 5432, but our policy only allowed traffic on port 80. It was a classic "oops" moment that standard Kubernetes tools would never have caught.

FAQ

Q: Does Hubble impact cluster performance? A: Because it uses eBPF, the overhead is minimal. We've seen roughly a 2-3% increase in CPU usage on nodes with high traffic, which is well worth the trade-off for the level of visibility provided.

Q: Can I use Hubble without Cilium? A: No, Hubble is deeply integrated with the Cilium data plane. You need Cilium as your CNI to get the eBPF hooks that Hubble requires.

Q: Is this better than standard NetworkPolicy logs? A: Yes. Standard Kubernetes logs are often inconsistent across different CNI providers. Hubble provides a consistent, high-fidelity view across the entire cluster.

Final Thoughts

Colorful confetti scattered over the word 'Finally' symbolizing celebration or achievement.

I'm still not 100% satisfied with our current policy management. While Hubble helps us debug, we're still manually writing these manifests. Next time, I think we need to look into automating the policy generation process using tools that can "learn" from existing traffic patterns. It's easy to get lost in the weeds of labels and selectors, and I’m sure we’ll break connectivity again if we don’t move toward a more declarative, automated approach.

Back to Blog

Similar Posts

Three metallic wrenches arranged on a rustic wooden table, top view.
KubernetesJune 19, 20263 min read

Implementing Kubernetes NodeLocal DNSCache for Lower DNS Latency

Learn how to implement Kubernetes NodeLocal DNSCache to slash DNS latency, reduce CoreDNS load, and improve overall cluster performance in production.

Read more
Overhead drone shot of busy city highway with cars and bus, surrounded by trees.
Kubernetes
June 19, 2026
3 min read

Kubernetes Ingress: NGINX vs Gateway API for Traffic Routing

Master Kubernetes Ingress with our deep dive into the NGINX Ingress Controller and the modern Kubernetes Gateway API for scalable traffic routing and load balancing.

Read more
From above contemporary server cable trays without wires located in modern data center
KubernetesJune 19, 20263 min read

Kubernetes Audit Logs and Falco: A Guide to API Server Security

Learn how to implement Kubernetes Audit Logs and Falco for robust threat detection. Secure your API server and monitor cluster activity with ease.

Read more