coredns 部分pod启动失败

查看现象及日志
1
2
3
4
5
6
7
8
9
10
11
[root@k8s-master ~]# kubectl get pod -n kube-system 
NAME READY STATUS RESTARTS AGE
coredns-59c7994f5d-87gq7 0/1 Running 2 4m5s
coredns-59c7994f5d-db78l 1/1 Running 0 4m5s
etcd-k8s-master 1/1 Running 9 274d
kube-apiserver-k8s-master 1/1 Running 11 2y121d
kube-controller-manager-k8s-master 1/1 Running 4 2y121d
kube-flannel-ds-amd64-77q6m 1/1 Running 0 3m58s
kube-flannel-ds-amd64-fdjgm 1/1 Running 0 3m18s
kube-flannel-ds-amd64-jrvjr 1/1 Running 0 2m41s
kube-proxy-n7qqj 1/1 Running 0 4m18s
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@k8s-master ~]# kubectl -n kube-system logs coredns-59c7994f5d-87gq7 
E0824 05:26:56.720802 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0824 05:26:56.720843 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0824 05:26:56.720971 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Namespace: Get https://10.96.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
.:53
[INFO] plugin/reload: Running configuration MD5 = 4e235fcc3696966e76816bcd9034ebc7
CoreDNS-1.6.7
linux/amd64, go1.13.6, da7f65b
E0824 05:26:59.792027 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0824 05:26:59.792049 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Namespace: Get https://10.96.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0824 05:26:59.792290 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0824 05:27:02.864586 1 reflector.go:153] pkg/mod/k8s.io/client-go@v0.17.2/tools/cache/reflector.go:105: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit

关键报错

Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host

路由问题导致:iptables -L

解决方法
1
2
3
4
# 先缩减
kubectl scale --replicas=0 deploy/coredns -n kube-system
# 再增加
kubectl scale --replicas=2 deploy/coredns -n kube-system
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2024 Outsrkem
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信