首先安装tcpdump: yum install tcpdump
kubectl get pod -o wide查看pod在哪个节点上
docker ps 查看container的id
查看pid: docker inspect -f {{.State.Pid}} $containerid
pod是宿主机上不同namespace中运行的进程,因此进入network namespace : nsenter --target $pid -n
使用tcpdump在8080端口抓包,tcpdump -i eth0 tcp and port 8080 -vvv |tcpdump -i eth0 tcp and port 8080 -vnn
参考:https://blog.csdn.net/zorsea/article/details/126760314
标签:8080,pid,tcp,pod,k8s,tcpdump,抓包 From: https://www.cnblogs.com/c-rex/p/17057997.html