报错:[etcd] Failed to bring up Etcd Plane: etcd cluster is unhealthy: hosts [10.0.2.15] failed to report healthy. Check etcd container logs on each host for more information
以上报错可能有两个原因,
- 主机时钟不同步
- 该主机之前添加过 kubernetes 集群,在残留数据没有清理干净的情况下重新安装集群
创建主机时,应该都会注意时间同步问题,大多数人遇到的应该是残留数据没有清理干净的情况。清理方法如下。
进入主机,创建shell脚本。
vim delete.sh
输入清理脚本。
#!/bin/bashKUBE_SVC='
kubelet
kube-scheduler
kube-proxy
kube-controller-manager
kube-apiserver
'for kube_svc in ${KUBE_SVC};
do
# 停止服务
if [[ `systemctl is-active ${kube_svc}` == 'active' ]]; then
systemctl stop ${kube_svc}
fi
# 禁止服务开机启动
if [[ `systemctl is-enabled ${kube_svc}` == 'enabled' ]]; then
systemctl disable $