Kubernetes安装中的预检错误

时间:2019-03-04 02:50:09

标签: kubernetes installation ubuntu-18.04

我指的是以下链接Installation Link,用于在Ubuntu 18.04上安装Kubernetes。输入命令时出现以下错误:

sudo kubeadm join 192.168.0.114:6443 --token qgce4f.tgzda1zemqnro1em --discovery-token-ca-cert-hash sha256:6ebc15a5a9818481f8a98af01a7a367ba93b2180babb954940edd8178548773a ignore-preflight-errors=All

W0303 18:33:39.565868    7098 join.go:185] [join] WARNING: More than one API server endpoint supplied on command line [192.168.0.114:6443 ignore-preflight-errors=All]. Using the first one.
[preflight] Running pre-flight checks
    [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 18.09.3. Latest validated version: 18.06
[preflight] Some fatal errors occurred:
[ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty
    [ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
    [ERROR Port-10250]: Port 10250 is in use
    [ERROR FileAvailable--etc-kubernetes-pki-ca.crt]: /etc/kubernetes/pki/ca.crt already exists
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

有人可以告诉我如何解决此问题吗?谢谢!

1 个答案:

答案 0 :(得分:0)

请考虑使用here中所述的kubeadm reset命令:

The "reset" command executes the following phases:

preflight              Run reset pre-flight checks
update-cluster-status  Remove this node from the ClusterStatus object.
remove-etcd-member     Remove a local etcd member.
cleanup-node           Run cleanup node.

此命令的第四阶段应修复您提到的4个错误:

A)它将停止kubelet服务-因此将释放端口10250

B)它将删除以下目录的内容:

    /etc/kubernetes/manifests 
    /etc/kubernetes/pki

C)将删除以下文件:

    /etc/kubernetes/admin.conf 
    /etc/kubernetes/kubelet.conf 
    /etc/kubernetes/bootstrap-kubelet.conf 
    /etc/kubernetes/controller-manager.conf 
    /etc/kubernetes/scheduler.conf

(*)确保以详细级别5和更高的级别运行kubeadm join命令(通过附加--v=5标志)。