Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preflight errors in Kubernetes installation

I am referring to the following link Installation Link for installing Kubernetes on Ubuntu 18.04. I am getting the following errors on typing the command :

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=...`

Can someone please tell me how to fix this? Thanks !

like image 840
LM10 Avatar asked Sep 04 '25 01:09

LM10


1 Answers

Consider using the kubeadm reset command as described here:

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.

The fourth phase of this command should fix the 4 errors you mentioned:

A ) It will stop the kubelet service - so port 10250 will be released.

B ) It will delete contents of the following directories:

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

C ) It will delete the following files:

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

(*) Make sure you run the kubeadm join command with verbosity level of 5 and above
(by appending the --v=5 flag).

like image 164
RtmY Avatar answered Sep 07 '25 08:09

RtmY