kubeadm join 超時報錯 error execution phase kubelet-start: error uploading crisocket: timed out waiting for the condition
問題分析:
可能是之前加入過k8s
解決方法:
kubeadm reset
之后重新加入即可。
報錯:[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.
問題分析:
之前我的Docker是用yum安裝的,docker的cgroup驅動程序默認設置為system。默認情況下Kubernetes cgroup為systemd,我們需要更改Docker cgroup驅動,
問題解決:
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF
systemctl restart docker
docker info
之后在node節點執行
kubeadm join 192.168.1.35:6443 --token jeemo6.q7nxl1rrc81kh76h \
--discovery-token-ca-cert-hash sha256:7a433336427311c06ae00e06d5a04a7d89ffb509fba7eb48b6b24503b6778ba9
注意:192.168.1.35是master節點IP