k8s使用kubeadm初始化報如下錯誤:
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 127.0.0.1:10248: connect: connection refused.
原因:
docker的cgroup驅動程序默認設置為system。默認情況下Kubernetes cgroup為systemd,我們需要更改Docker cgroup驅動,
解決辦法:
kubeadm reset
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
[root@master01 ~]# systemctl daemon-reload
systemctl restart docker
重新初始化即可成功。