When your Kubernetes microservices start misbehaving, the first question every engineer asks is: what is actually happening on the wire? Pod-to-pod communication in a Kubernetes cluster involves multiple abstraction layers — Container Network Interface (CNI) plugins, service mesh sidecars, iptables or eBPF-based routing, and encrypted TLS tunnels. Traditional packet capture tools struggle in this environment because traffic is ephemeral, distributed across nodes, and often encrypted end-to-end.
In this guide, we compare three approaches to Kubernetes traffic analysis: Kubeshark (eBPF-powered live dashboard), ksniff (kubectl plugin streaming tcpdump to Wireshark), and the classic Wireshark desktop application. Each has a distinct place in the debugging workflow, and understanding when to reach for which tool will save you hours during incident response.
Why Self-Hosted Kubernetes Traffic Analysis Matters
Debugging network issues in a Kubernetes cluster is fundamentally different from debugging a single server. A typical request flows through multiple pods, services, ingress controllers, and possibly a service mesh — each adding headers, encryption, or routing decisions. When latency spikes or connections fail, you need visibility into the actual packets traversing your cluster.
Self-hosted traffic analysis tools give you that visibility without sending sensitive network data to third-party SaaS platforms. For teams running workloads with compliance requirements (HIPAA, SOC 2, GDPR), keeping packet captures and traffic metadata within your own infrastructure is non-negotiable. Additionally, self-hosted tools work in air-gapped environments and do not depend on external API availability during outages.
For related reading, see our eBPF networking observability guide with Cilium, Pixie, and Tetragon and our Kubernetes debugging tools comparison covering Stern, Kubetail, and Inspektor Gadget.
Kubeshark: eBPF-Powered Live Traffic Dashboard
Kubeshark is an open-source network observability tool built specifically for Kubernetes. It uses eBPF (Extended Berkeley Packet Filter) to hook into the kernel’s networking stack and capture all cluster-wide traffic at the socket level. Unlike traditional packet capture, Kubeshark decrypts TLS/mTLS traffic automatically using eBPF — no sidecar proxies, no key injection, no application changes required.
With over 11,883 GitHub stars and weekly active development, Kubeshark has become one of the most popular K8s-native traffic analysis tools. Its web-based dashboard provides real-time visibility into every connection, with the ability to filter by namespace, workload, protocol, or custom query expressions.
Key Features
- Automatic TLS decryption — eBPF hooks extract plaintext from encrypted traffic without certificate access
- L7 protocol dissection — HTTP, gRPC, DNS, Kafka, AMQP, Redis, PostgreSQL, and more are automatically parsed
- Kubernetes-aware queries — filter traffic by namespace, pod, service, deployment, or label selectors
- Retrospective PCAP downloads — export cluster-wide packet captures filtered by time range and workload
- MCP server integration — expose captured traffic data to external tools via the Model Context Protocol
- Real-time streaming — see traffic as it happens with sub-second latency on the dashboard
Installing Kubeshark via Helm
The recommended installation method uses the official Helm chart. Kubeshark deploys a set of worker pods (one per node) that run eBPF probes, plus a central hub that aggregates and indexes the captured data:
| |
Once the port-forward is active, open http://localhost:8899 in your browser. The dashboard immediately begins showing live traffic from all pods in the cluster.
Running Kubeshark via CLI
For quick debugging sessions, the kubeshark CLI provides a one-command alternative:
| |
Production Deployment with Ingress
For persistent deployments, expose Kubeshark through an ingress controller rather than relying on port-forwarding:
| |
Important: Always protect the Kubeshark dashboard with authentication. It exposes plaintext network traffic — including credentials and tokens — to anyone with access to the web UI.
ksniff: tcpdump Meets Wireshark on Kubernetes
ksniff takes a different approach. Instead of deploying a persistent monitoring stack, ksniff is a kubectl plugin that uploads a statically compiled tcpdump binary to your target pod, starts a capture, and streams the output directly to your local Wireshark instance. This gives you the full power of Wireshark’s protocol dissectors with minimal impact on the running pod.
With 3,446 GitHub stars, ksniff is a lightweight tool ideal for targeted debugging of individual pods. However, note that the project has not seen major updates since August 2024, and the maintainers explicitly state it is not production-ready.
Installing ksniff
ksniff installs via krew, the kubectl plugin manager:
| |
Using ksniff to Capture Pod Traffic
The basic workflow is simple — point ksniff at a pod and Wireshark opens automatically:
| |
How ksniff Works Under the Hood
When you run kubectl sniff, the plugin:
- Connects to the target pod using
kubectl exec - Uploads a statically compiled tcpdump binary to
/tmp/tcpdumpinside the container - Starts tcpdump with your specified filter
- Streams the pcap output back through the kubectl exec channel
- Pipes the stream into your local Wireshark for real-time analysis
This approach is clever but has limitations. It requires the target pod to allow kubectl exec, and the uploaded tcpdump binary must be compatible with the pod’s architecture. Pods running as nonroot with restrictive security contexts may reject the binary upload.
Wireshark: The Classic Desktop Packet Analyzer
Wireshark is the industry-standard network protocol analyzer. With over 9,270 stars on its GitHub mirror and decades of development, it supports more protocols than any other tool. However, Wireshark is a desktop application — it captures traffic from a network interface on the machine where it runs, not from inside a Kubernetes cluster.
Using Wireshark with Kubernetes
To use Wireshark for Kubernetes traffic analysis, you have several options:
Option 1: Capture on a cluster node
| |
Option 2: Run tcpdump in a debug pod and open the pcap locally
| |
Option 3: Use the kubectl debug ephemeral containers
| |
Feature Comparison
| Feature | Kubeshark | ksniff | Wireshark |
|---|---|---|---|
| Architecture | eBPF kernel probes | tcpdump binary injection | Desktop packet capture |
| Deployment | Helm chart / CLI | kubectl krew plugin | Desktop application |
| Traffic scope | Entire cluster | Single pod | Local machine interface |
| TLS decryption | Automatic via eBPF | Manual (requires keys) | Manual (requires key log) |
| L7 protocol parsing | HTTP, gRPC, DNS, Kafka, Redis, PostgreSQL | Via Wireshark dissectors | 3,000+ protocols |
| Real-time dashboard | Web-based UI | Wireshark desktop | Wireshark desktop |
| Kubernetes awareness | Native (namespace, labels, workloads) | Pod-level only | None |
| PCAP export | Cluster-wide, filtered by time/workload | Single pod stream | Local interface capture |
| Production readiness | Yes | No (per maintainer) | Yes |
| GitHub stars | 11,883 | 3,446 | 9,270+ |
| Last updated | April 2026 | August 2024 | April 2026 |
| Resource overhead | Moderate (one worker per node) | Minimal (per-capture only) | None on cluster |
| Multi-node capture | Yes (automatic) | No (one pod at a time) | No (one interface at a time) |
| Air-gapped support | Yes (self-hosted) | Yes (offline plugin) | Yes (offline desktop) |
Choosing the Right Tool
Use Kubeshark when:
- You need cluster-wide visibility into all network traffic
- TLS/mTLS decryption without sidecars is required
- You want a persistent monitoring stack with a web dashboard
- Incident response requires retrospective traffic queries across multiple pods
- You need L7 protocol parsing for HTTP, gRPC, Kafka, or Redis traffic
Use ksniff when:
- You need to debug a specific pod’s network traffic quickly
- Your team is already comfortable with Wireshark’s interface
- You want minimal resource overhead (no persistent deployment)
- The target pod allows
kubectl execand has a compatible architecture - You are debugging in a development or staging environment
Use Wireshark directly when:
- You are analyzing traffic at the node level (CNI bridges, host networking)
- You need deep protocol analysis for obscure or custom protocols
- You are working in an environment where cluster tool deployment is not possible
- You are reviewing saved pcap files from any source
- You need offline analysis with no cluster connectivity
For more on packet capture fundamentals, check our tcpdump vs tshark vs termshark comparison.
Common Debugging Scenarios
Scenario 1: Intermittent Connection Timeouts Between Services
When pod A intermittently fails to reach pod B on port 8080:
| |
Scenario 2: Debugging gRPC Connection Errors
gRPC uses HTTP/2, which requires protocol-specific analysis:
| |
Scenario 3: Verifying mTLS Is Working Correctly
| |
FAQ
Does Kubeshark work with all CNI plugins?
Yes. Kubeshark uses eBPF to capture traffic at the kernel socket level, which is independent of the CNI plugin. It works with Calico, Cilium, Flannel, Weave Net, and any other CNI that operates on standard Linux networking. The eBPF probes attach to network socket events rather than specific network interfaces.
Is Kubeshark safe to run in production?
Kubeshark is designed for production use and runs as read-only eBPF probes that do not modify network traffic. However, the dashboard exposes plaintext data — including credentials, tokens, and sensitive payloads. Always enable authentication (basic auth, OAuth, or network policies) and restrict access to the dashboard using Kubernetes NetworkPolicies or ingress authentication.
Why is ksniff not recommended for production?
The ksniff maintainers explicitly state the tool is not production-ready. It uploads arbitrary binaries into running containers via kubectl exec, which can violate security policies, trigger audit alerts, or fail on hardened pods with read-only filesystems or restricted security contexts. For production environments, prefer Kubeshark or kubectl debug ephemeral containers.
Can I use Wireshark to decrypt TLS traffic from Kubernetes?
Yes, but you need the TLS session keys. For applications that support SSLKEYLOGFILE (curl, Firefox, Chrome, many Go applications), set the environment variable and collect the key log file. Then configure Wireshark (Edit → Preferences → Protocols → TLS) to read the key log. For mTLS traffic in a service mesh, you would need the mesh’s CA keys — which Kubeshark avoids entirely by using eBPF-based decryption.
How much cluster resource does Kubeshark consume?
Kubeshark deploys one worker pod per node, each typically using 100-500m CPU and 256Mi-1Gi memory depending on traffic volume. The hub pod uses approximately 200m CPU and 512Mi memory. For a 10-node cluster, expect a total overhead of roughly 1-2 CPU cores and 3-6 GB RAM. You can tune resource limits via Helm values:
| |
Does Kubeshark support offline or air-gapped environments?
Yes. Kubeshark is fully self-hosted and does not require any external connectivity. You can pull the Docker images (kubeshark/worker, kubeshark/hub, kubeshark/front) in an internet-connected environment, transfer them to your air-gapped registry using docker save / docker load, and install via Helm with --set global.imageRegistry=your-internal-registry.example.com.