Jenkins k8s plugin pod反复重启,connect: no route to host

在新安装的CentOS虚拟机上,作为Kubernetes(K8s)节点运行的Pod反复重启。错误信息显示为无法连接到主机。问题可能与网络配置或iptables规则有关。解决方案包括清空iptables规则。参考了Rancher/rancher的GitHub Issue#6139来解决这个问题。
摘要由CSDN通过智能技术生成

新安装了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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值