the pod's node and IP address. $ kubectl get pod $POD_NAME -o wide # 2. SSH into the correct node. $ ssh my-user@$NODE_NAME # 3. On the node, run tcpdump on the main interface, # filtering by the pod's IP. # tcpdump -i eth0 -n -w capture.pcap "host $POD_IP" BPF Filter: The "what" to capture Write to file No DNS Resolution Interface to listen on
problem is outside of the application container. Examples: • Pod A can't reach Pod B on a different node. • A NetworkPolicy is unexpectedly blocking traffic. Pod Pod 💣❓
problem is inside of the application container. Examples: • Your application fails to start, complaining it can't bind to port 8080. • Istio service mesh sidecar is causing issues. ◦ Capturing on the lo interface allows you to see mTLS traffic unencrypted Pod Pod 💣❓
On-Node Approach. Requires high privileges. • eth0 on nodes: for capturing traffic as the node sees it [outside pod] • nsenter: for capturing traffic as the application sees it [inside pod] 🏪 Strategy 2: The Binary Upload Approach (ksniff). [inside pod] Convenient, but be mindful of its intrusiveness. 🌟 Strategy 3: The In-Pod Approach (kubectl debug). [inside pod] A Kubernetes-native approach, with flexibility and ease-of-use. 🚀 Keep an eye on eBPF, the future of network observability.