Kubernetes: kubeadm join in master node fail

11/6/2018

I was trying to create a single master cluster with kubeadm in a CentOS VM.

I would like to schedule pods on the master node, so I run the following

kubectl taint nodes --all node-role.kubernetes.io/master-

But then, when I try to run

kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>

with the proper input of token, master-ip, master-port and hash.The pre-flight checks give the following errors:

/etc/kubernetes/manifests is not empty
/etc/kubernetes/kubelet.config already exists
Port 10250 is in use
/etc/kubernetes/pki/ca.crt already exists

How can I fix the errors so that pods can still be scheduled on master node? Thanks

-- K_inverse
kubeadm
kubernetes

1 Answer

11/6/2018

You basically don't need kubeadm join on the master since it's already set up by kubeadm init. Also, the fact that you removed the taint on your master node to run pods should be enough for you to run pods on the master (use this just for test).

If you want a K8s node to join a cluster to run your pods you would use kubeadm join, in this case, you could taint your master to not run any pods. (You could remove the taint if you wanted to, but it's not recommended to run workloads on your master, especially in production)

-- Rico
Source: StackOverflow