error execution phase preflight: couldn't validate the identity of the API Server: Get dial tcp connect: no route to host

kubernetes(k8s)DNS 服务反复重启解决: Failed to list *v1.Service: Get dial tcp getsockopt: no route to host

在使用 Minikube 部署 kubernetes 服务时,出现 Kube DNS 服务反复重启现象(错误如上),

这很可能是 iptables 规则乱了,我通过执行以下命令解决了,在此记录:

1.回到kubernees-maser  依次输入列命令
systemctl stop kubelet
systemctl stop docker
iptables --flush
iptables -tnat --flush
systemctl start kubelet
systemctl start docker



# kubeadm token create


# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'



   3.在kubernetes-slave中执行此命令 join就成功了

#  kubeadm join –token 424mp7.nkxx07p940mkl2nd \ --discovery-token-ca-cert-hash sha256:d88fb55cb1bd659023b11e61052b39bbfe99842b0636574a16c76df186fd5e0d


posted @ 2020-07-22 00:40  骇客黑界  阅读(3799)  评论(0编辑  收藏  举报