我尝试将我的 kubeadm 集群与三个大师堆叠在一起。我从我的 init 命令收到此问题...
[kubelet-check] Initial timeout of 40s passed.
Unfortunately, an error has occurred:
timed out waiting for the condition
This error is likely caused by:
- The kubelet is not running
- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)
If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
- 'systemctl status kubelet'
- 'journalctl -xeu kubelet'
Additionally, a control plane component may have crashed or exited when started by the container runtime.
To troubleshoot, list all containers using your preferred container runtimes CLI, e.g. docker.
Here is one example how you may list all Kubernetes containers running in docker:
- 'docker ps -a | grep kube | grep -v pause'
Once you have found the failing container, you can inspect its logs with:
- 'docker logs CONTAINERID'
error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
但是我不使用cgroupfs,而是使用 systemd 我的kubelet抱怨不知道他的节点名。
Jan 23 14:54:12 master01 kubelet[5620]: E0123 14:54:12.251885 5620 kubelet.go:2266] node "master01" not found
Jan 23 14:54:12 master01 kubelet[5620]: E0123 14:54:12.352932 5620 kubelet.go:2266] node "master01" not found
Jan 23 14:54:12 master01 kubelet[5620]: E0123 14:54:12.453895 5620 kubelet.go:2266] node "master01" not found
请让我知道问题出在哪里。
答案 0 :(得分:1)
问题可能是由于Docker版本造成的,因为最新的kubernetes版本(即v1.13.xx)支持docker版本<18.6。
实际上我也遇到了同样的问题,但是在将Docker版本从18.9降级到18.6之后,它得到了解决。
答案 1 :(得分:0)
如果问题与Docker不相关,则可能是因为Kubelet服务无法建立与API服务器的连接。
我首先要检查Kubelet的状态:systemctl status kubelet
,并考虑使用systemctl restart kubelet
重新启动。
如果这没有帮助,请尝试重新安装kubeadm或使用其他版本运行kubeadm init
(使用--kubernetes-version=X.Y.Z
标志)。
答案 2 :(得分:0)
就我而言,我的 k8s 版本是 1.21.1,我的 docker 版本是 19.03。我通过将 docker 升级到 20.7 版解决了这个错误。