原因:机房断电,导致服务重启
[root@master1 logs]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-57d84f57dc-57fkf 1/1 Running 0 75s
[root@master1 logs]# kubectl logs -f nginx-57d84f57dc-b866m
Error from server (NotFound): pods "nginx-57d84f57dc-b866m" not found
[root@master1 logs]# kubectl exec -it nginx-57d84f57dc-57fkf -- bash
Error from server: error dialing backend: dial tcp 10.10.10.14:10250: connect: no route to host
[root@master1 logs]# kubectl exec -it nginx-57d84f57dc-57fkf -- sh
Error from server: error dialing backend: dial tcp 10.10.10.14:10250: connect: no route to host
解决:
检查pod所在的node节点服务器是否开启了防火墙
关闭防火墙:
临时关闭:systemctl stop firewalld
永久关闭:sed -i 's/enforcing/disabled/' /etc/selinux/config