k8s初始化 报错Error getting node“ err=“node

在尝试使用kubeadm初始化Kubernetes集群时,遇到了Kubelet启动失败并超时的问题。错误信息表明可能是由于Kubelet未运行或者配置错误导致。解决方案是确认Kubelet版本与kubeadm兼容,特别是避免使用已被弃用的Docker。通过降级Kubelet、kubeadm、kubectl到1.23.6版本,问题得到了解决。
摘要由CSDN通过智能技术生成

    [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

  • 10
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 55
    评论
评论 55
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值