[root@hadoop002 k8s]# kubectl get po # 查看pod名称
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 116s
[root@hadoop002 k8s]# kubectl debug -it nginx --image=busybox:1.28 # 使用容器busybox来进入nginx中进行调试,如果有命名空间显示可以进项添加--target如:kubectl debug -it nginx --image=busybox:1.28 --target=nginx
Defaulting debug container name to debugger-z6mv2.
If you don't see a command prompt, try pressing enter.
/ # netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 000.0.0.0:80 0.0.0.0:* LISTEN -
tcp 00 :::80 :::* LISTEN -