新安装了centos的虚拟机作为K8s 的node,添加完成后使用Jenkins指定该node启动pod,但是会反复重启

报错如下:

 查看log:

$ kubectl get pod -n xxx | grep yyy | awk '{print $1}' | xargs -I {} kubectl logs {} -c default  -n xxx
Error from server: Get "xxxxxx/default": dial tcp xxx.xxx.xx.xx: connect: no route to host
Error from server: Get "xxxxxx/default": dial tcp xxx.xxx.xx.xx: connect: no route to host
Error from server: Get "xxxxxx/default": dial tcp xxx.xxx.xx.xx: connect: no route to host
Error from server: Get "xxxxxx/default": dial tcp xxx.xxx.xx.xx: connect: no route to host
Error from server: Get "xxxxxx/default": dial tcp xxx.xxx.xx.xx: connect: no route to host

解决办法:

iptables --flush
iptables -tnat --flush

参考:

Unable to access kubernetes services: no route to host · Issue #6139 · rancher/rancher · GitHub

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐