关于Kubernetes-v1.23.6-初始化时报错[kubelet-check] It seems like the kubelet isn't running or healthy
博客园 2023-05-07 10:13:18

笔者今天在对k8s,v1.23.6版本的的master节点使用如下命令进行初始化时


(资料图)

[root@k8s-master qq-5201351]# kubeadm init \> --apiserver-advertise-address 192.18.106.87 \> --image-repository registry.aliyuncs.com/google_containers \> --kubernetes-version v1.23.6 \> --service-cidr=10.96.0.0/12 \> --pod-network-cidr=10.224.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.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248/healthz": dial tcp [::1]:10248: connect: connection refused.        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 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 clusterTo see the stack trace of this error execute with --v=5 or higher

其核心报错,也就如下几条,最为主要的就是说,kubelet isn"t running or healthy.

[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifes ts". This can take up to 4m0s[kubelet-check] Initial timeout of 40s passed.[kubelet-check] It seems like the kubelet isn"t running or healthy.[kubelet-check] The HTTP call equal to "curl -sSL http://localhost:10248/healthz" failed with error: Get "http://localhost:10248 /healthz": dial tcp [::1]:10248: connect: connection refused.

刚看到这个报错时,还是有一点懵的,但仔细一看,还好下面提出了一些排查方法,和可能的原因 ,其中有一点看起来很是有用

- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

这个与docker的一个配置有关系,即要求将cgroups disabled,于是笔者尝试如下解决方法

到/etc/docker/daemon.json配置文件中,至少需要添加上如下一段内容(如果有其他配置选项也可以添加到花括号之中)

{"exec-opts":["native.cgroupdriver=systemd"]}

说明:docker默认使用的Cgroup Driver是cgroupfs,我们上面是将其修改成systemd,这些通过docker info可以看出

然后我们重启docker让配置生效,因为这才刚开始从master节点搭建,于是笔者再使用kubeadm reset重置

最后我们再进行kubadm初始化master节点时,就不会有报错了~

尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/17378926.html

猜你喜欢

关于Kubernetes-v1.23.6-初始化时报错[kubelet-check] It seems like the kubelet isn't running or healthy

2023-05-07

e城e家如何交燃气费 怎么在e城e家上交燃气费-焦点短讯

2023-05-07

北京再现抢地大战,丰台大兴两宗宅地高溢价成交

2023-05-07

国际原子能机构总干事:扎波罗热核电站所在城市居民开始疏散

2023-05-07

日丰股份

2023-05-07

生态环境部启动第三次海洋污染基线调查工作 最新

2023-05-07

厦门佛事展门票需要买吗?

2023-05-07

不舍离别的诗句_不舍

2023-05-06

药店加盟店排行榜大全_药店加盟店排行榜

2023-05-06

反食品浪费法两年:任重道远

2023-05-06

渭城区气象台发布大雾黄色预警【Ⅲ级/较重】【2023-05-06】_焦点热门

2023-05-06

杨安队率队来雄开展“百县千镇万村高质量发展工程”深调研座谈会 世界动态

2023-05-06

精彩看点:星网锐捷:公司会关注行业的发展情况并根据自身的实际情况制定相应的发展战略

2023-05-06

环球热讯:为何越是想赚钱,越是抓不住?认清这4个财富本质,残酷却很真实

2023-05-06

2023年杭州幼升小政策有哪些

2023-05-06

热门推荐