Tag Archives: ERROR FileAvailable–etc-kubernetes-kubelet.conf

k8s Error: [ERROR FileAvailable–etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists

Error log:

[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists
    [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=...`

The reason is: some configuration files and services already exist

#reset kubeadm 
kubeadm reset

After running the kubeadm join command


Cause: There are residual files
Solution: (works)

#Delete k8s configuration file and certificate file
rm -rf /etc/kubernetes/kubelet.conf /etc/kubernetes/pki/ca.crt #Delete k8s configuration file and certificate file
kubeadm join --token xvnp3x.pl6i8ikcdoixkaf0 \
    --discovery-token-ca-cert-hash sha256:9f90161043001c0c75fac7d61590734f844ee507526e948f3647d7b9cfc1362d