问题描述:
在docker容器中运行一个k3s集群,启动一个Pod,指定其hostPort字段为80端口,更新Deploy后Pod为Pending状态,无法启动,Status为当前node上端口被占用
环境:
suseLinux
检查端口占用情况
zypper install net-tools
Deprecated Tool Alternative Toolarp ip nifconfig ip aipmaddr ip maddriptunnel ip tunnelnetstat ssip route (netstat -r)ip -s link (netstat -i)route ip rmii-tool ethtoolnameif ifrename
使用ss查看端口占用情况
ss -alnp|grep 8888
发现没有监听
查看iptables
zypper install iptables
kubectl get po -owide
查看到前端服务对应的Pod ip为10.42.1.17
zypper install iproute2
https://commandnotfound.cn/linux/1/232/ss-%E5%91%BD%E4%BB%A4
https://blog.csdn.net/weixin_41282397/article/details/85705848
https://blog.csdn.net/samson_www/article/details/80377431
k8s中的hostPort
https://developer.aliyun.com/article/796076
