Daily Archives: 26.05.2021
Using tcpdump for k8s pods
You need wireshark to be installed on your local machine — download (more on this below). If you don’t have tcpdump installed inside the pod, you can install it with
1 2 3 4 5 |
# get pod name kubectl get po -Lversion,cfg,infra-cfg -lapp=<pod-tag> kubectl exec -it <pod-name> sh # inside the pod, alpine apk add tcpdump |
Then, on your local machine:
1 |
kubectl exec <pod-name> -- tcpdump -i eth0 -w - | wireshark -k -i - |
If you want to see packets in grpc/http2, you can add a rule in Wireshark. For this, click …