Tcpdump can Power your Kubernetes Troubleshooting
When I started my first job in 2009, my seniors often used tcpdump during troubleshooting. Every time we had a major issue, my boss always requested for a tcpdump capture to analyze. Its very useful.
Btw, here's a demo video I created recently how you can troubleshoot application latency issue in Kubernetes. It's a short one, but trust me, this will help you sooner or later.
Some backstory: Back then we had our app hosted on state data center and our team managed both the servers and the application.
Tcpdump is a super cool tool. It's simple, it's versatile and most importantly it's cost-effective for small / medium organizations. What makes it so awesome is its ability to capture and analyze network traffic in real-time. I used it a lot and I use it even today.
Ok, while newer tools were introduced, tcpdump remains a useful tool for network troubleshooting.
So, you may ask, what problems can tcpdump solve? Here are some:
1. Connectivity problems: Why a pod can't reach a service or external resource.
2. Performance problems: Identifying network-related slowdowns.
3. Security issues: Detecting suspicious network activity.
4. Protocol-specific issues: Analyzing TCP/IP, UDP, or others.
Here are some use-cases for Kubernetes:
Pod-to-Pod Communication:
Verify if pods can communicate with each other pod.
Check firewall or network policies that are blocking traffic.
Analyze the TCP handshake and data transfer. Identify packet loss issues.
Pod-to-Service Communication:
Check pods can resolve service names and connect to correct endpoints.
Investigate software load balancer issues or DNS problems.
Pod-to-External Network:
Troubleshoot connectivity to external services, the internet, or other clusters.
Verify network address translation (NAT) or firewall rules.
Analyze routing issues and latency.
Alright then. That's all I have for today.
Hope this is a useful read. Do check out the tcpdump demo. If you like it, I will make more similar videos. Thank you for reading. Do check out my previous substack post here.

