[root@master ~]#kubeadm init \
    --apiserver-advertise-address=192.168.255.168 \
    --image-repository registry.aliyuncs.com/google_containers \
    --service-cidr=10.1.0.0/16 \
    --pod-network-cidr=10.244.0.0/16 
我执行了上面这条命令之后就会在下面这里卡很久
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
然后就报下面这个错
[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.
Here is one example how you may list all running Kubernetes containers by using crictl:
    - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock ps -a | grep kube | grep -v pause'
    Once you have found the failing container, you can inspect its logs with:
    - 'crictl --runtime-endpoint unix:///var/run/containerd/containerd.sock logs CONTAINERID'
error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher
[root@master ~]# 
执行下面命令显示报错
[root@master ~]# journalctl -xeu kubelet
5月 21 21:07:57 master kubelet[15135]: E0521 21:07:57.697075   15135 kubelet.go:2419] "Error getting node" err="node

就出现这个错误,我几个node的IP地址检查过好多遍也没问题
上网找了很多方法都解决不了

咋整啊

==================================

解决方法:

我问了下我老师,也查了下资料k8s 已经弃用了docker了,如果安装的kubelet   kubeadm  kubectl
是V1.24就会出现以上错误,安装的时候指定一下1.23版本,就可以解决了:yum install -y kubelet-1.23.6 kubeadm-1.23.6 kubectl-1.23.6

参考连接:https://blog.csdn.net/weixin_46415378/article/details/124435362?spm=1001.2014.3001.5502

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐