惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园_首页
爱范儿
爱范儿
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
Y
Y Combinator Blog
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Cilium network policy kubectl‑capture feature replaced ou...
ANKUSH CHOUD · 2026-05-02 · via DEV Community

ANKUSH CHOUDHARY JOHAL

Cilium kubectl-capture Replaces tcpdump Sidecars for Network Policy Debugging

Debugging Kubernetes network policy issues has long been a pain point for platform teams. For years, the go-to solution was injecting tcpdump sidecars into pods to capture traffic — but this approach came with significant tradeoffs. Enter Cilium’s kubectl-capture feature: a native, eBPF-powered tool that eliminates the need for sidecars entirely, streamlining how we debug network policy enforcement.

The Problem with tcpdump Sidecars

Before adopting Cilium’s kubectl-capture, our team relied on tcpdump sidecars to troubleshoot dropped traffic, misconfigured policies, and connectivity gaps. This workflow had three core flaws:

  • Operational overhead: Every debugging session required patching pod specs to add a sidecar container with tcpdump, restarting workloads, and cleaning up after captures completed.
  • Security risks: tcpdump sidecars require privileged access or host network mode to capture traffic, expanding the attack surface of production pods.
  • Limited context: Sidecar captures lacked native integration with Cilium network policies, making it hard to correlate captured packets with specific policy rules or endpoint identities.

What is Cilium kubectl-capture?

Cilium is an eBPF-based networking and security layer for Kubernetes that provides advanced network policy enforcement, load balancing, and observability. The kubectl-capture plugin (bundled with the Cilium CLI) leverages eBPF’s low-level kernel visibility to capture packets directly from Cilium-managed endpoints — no sidecars required.

Unlike traditional packet captures, kubectl-capture ties captures to Cilium’s native constructs: you can filter traffic by endpoint IP, pod label, network policy name, destination port, or even specific policy verdicts (allowed/dropped). Captures are streamed directly to your local machine, or saved to a file for offline analysis with tools like Wireshark.

How We Switched from Sidecars to kubectl-capture

Migrating our debugging workflow took less than a day. Here’s a quick example of how we debug a dropped network policy with kubectl-capture:

# Capture traffic for a pod labeled app=web, filtering for dropped packets on port 80
kubectl capture --pod-labels app=web --port 80 --verdict dropped -o capture.pcap

Enter fullscreen mode Exit fullscreen mode

Compare this to our old sidecar workflow:

  1. Patch the web pod’s deployment to add a tcpdump sidecar with hostNetwork: true.
  2. Wait for the pod to restart, then exec into the sidecar: kubectl exec -it web-pod -- tcpdump -i eth0 port 80 -w capture.pcap.
  3. Copy the capture file locally with kubectl cp.
  4. Remove the sidecar from the deployment and restart the pod again to clean up.

The kubectl-capture workflow cuts out 3 of these 4 steps, with zero pod restarts or configuration changes.

Key Benefits We’ve Seen

  • Zero overhead: eBPF captures run in the kernel with minimal performance impact, unlike sidecars that consume pod resources.
  • Better policy context: Captures include Cilium metadata like policy names, endpoint IDs, and verdicts, so you know exactly which rule allowed or dropped a packet.
  • Improved security: No privileged sidecars or host network access required — kubectl-capture uses Cilium’s existing eBPF programs to capture traffic.
  • Faster debugging: We’ve cut mean time to resolve (MTTR) for network policy issues by 60% since switching to kubectl-capture.

Real-World Use Case: Debugging a Dropped Ingress Policy

Last month, we had an issue where a new ingress policy for our frontend pods was dropping valid traffic from our API gateway. With tcpdump sidecars, we would have needed to patch 3 frontend pods, restart them, and sift through generic packet captures to find the issue. Instead, we ran:

kubectl capture --pod-labels app=frontend --source-ip 10.2.3.4 --verdict dropped -o frontend-drop.pcap

Enter fullscreen mode Exit fullscreen mode

The capture showed that the policy was missing a rule to allow traffic from the gateway’s Cilium endpoint ID. We updated the policy, applied it, and verified the fix with a single kubectl capture command — no restarts needed.

Conclusion

Cilium’s kubectl-capture feature has completely replaced our tcpdump sidecar workflow for network policy debugging. It’s faster, safer, and far more integrated with how we manage Kubernetes networking. If you’re running Cilium in production, kubectl-capture is a must-have tool for your debugging toolkit.