执行k8s时报错:
[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/heal
**
解决办法如下:
[root@k8smaster ~]# vim /etc/docker/daemon.json
添加一行:“exec-opts”: [“native.cgroupdriver=systemd”],注意上一行需要添加一个逗号
{
“registry-mirrors”:
[“https://docker.1panel.live”,
“https://hub.rat.dev”,
“https://docker.actima.top”,
“https://docker.1ms.run”,
“https://docker.aityp.com”,
“https://docker.xuanyuan.me”,
“https://docker-registry.nmqu.com”,
“https://docker.hlmirror.com”,
“https://docker.tbedu.top”
],
"exec-opts": ["native.cgroupdriver=systemd"]
}
重启docker服务
[root@k8smaster ~]# systemctl daemon-reload
[root@k8smaster ~]# systemctl restart docker kubelet containerd
初始化成功啦