the pod data packet capture kubernetes

Due to troubleshooting, to be caught in the pod of the data k8s for analysis. Steps will now be recorded as follows:
1. First find the pod where the node
kubectl GET pod -n -o Wide namespace
2. Log on to the host where the node
3. Find the PodID for
Docker PS | grep podname
4. Find a container process according to the PID podId
docker inspect --format "{{.State.Pid} }" podID
obtained as pid 2222
5. Log containers nsenter
nsenter -n -t2222
6. The packet capture with tcpdump
tcpdump -i -w file path port NIC port
7. the capture local data download, use wireshark analysis
completed

Published 12 original articles · won praise 1 · views 5430

Guess you like

Origin blog.csdn.net/zhangzhen02/article/details/104670121