k8s 版本是 1.17.0 ,用的是 calico 网络,加入集群时卡在下面的地方:
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
[kubelet-check] Initial timeout of 40s passed.
journalctl -xeu kubelet 查看日志,发现下面的错误:
Jan 05 15:35:53 k8s-node5 kubelet[8659]: E0105 15:35:53.781000 8659 kubelet.go:2263] node "k8s-node5" not found
Jan 05 15:35:53 k8s-node5 kubelet[8659]: E0105 15:35:53.800421 8659 reflector.go:156] k8s.io/client-go/informers/factory.go:135: Failed to list *v1beta1.CSIDriver: csidrivers.storage.k8s.io is forbidde
请问如何解决这个问题?
重新加入,等到 "Unfortunately, an error has occurred: timed out waiting for the condition" 错误时查看 kubelet 日志发现下面的错误:
Jan 05 16:01:03 k8s-node5 kubelet[23099]: E0105 16:01:03.197834 23099 bootstrap.go:240] unable to read existing bootstrap client config: invalid configuration: [unable to read client-cert /var/lib/kubel
Jan 05 16:01:03 k8s-node5 kubelet[23099]: F0105 16:01:03.197873 23099 server.go:273] failed to run Kubelet: unable to load bootstrap kubeconfig: stat /etc/kubernetes/bootstrap-kubelet.conf: no such file
改为 --v=6
加入集群,控制台日志出现 "Skipping certs download" 以及很多 "Config loaded from file"
controlplaneprepare.go:211] [download-certs] Skipping certs download
...
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
I0106 17:06:44.333442 20439 loader.go:375] Config loaded from file: /etc/kubernetes/kubelet.conf
I0106 17:06:44.832722 20439 loader.go:375] Config loaded from file: /etc/kubernetes/kubelet.conf
I0106 17:06:45.332732 20439 loader.go:375] Config loaded from file: /etc/kubernetes/kubelet.conf
....
是使用的root
用户执行加入集群命令,并且加入的discovery-token-ca-cert-hash
和token
都确认没有过期吗
没有过期
我也遇到了一样的问题,请问有解决吗?
不好意思,忘了后来是怎么解决的。
用1台新的服务器全新安装 k8s 后加入机器也是同样的问题
– dudu 4年前