# Not able to join node to Master

**URL:** <https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123>\
**Category:** General Discussions\
**Created:** [July 12, 2019, 7:16am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123 "2019-07-12T07:16:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peeyush2019](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/peeyush2019/32/3300_2.png) [@Peeyush2019](https://discuss.kubernetes.io/u/Peeyush2019)\
**Post date:** [July 12, 2019, 7:16am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/1 "2019-07-12T07:16:26Z")

</div>

Hello,

I am not able to join Node to Kubernetes master. Earlier I was able to join node to master but I had some issues on master , so I had to reset it. I reset it by using kubeadm reset command and was able to successfully access Kubernetes dashboard.

However, when I am trying to join node to master, I am getting the following error-  
error execution phase preflight couldn’t validate the identity of the api server: abort connecting to API servers after timeout of 5m0s

I have also tried to reset kubeadm but still getting the above error.

Please note that this is the second time I am joining node to master.

Any help is greatly appreciated!.

---

<div class="post-metadata">

**Author:** ![yog\_raj](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/yog_raj/32/3585_2.png) [@yog\_raj](https://discuss.kubernetes.io/u/yog_raj)\
**Post date:** [September 2, 2019, 11:59am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/2 "2019-09-02T11:59:19Z")

</div>

@peeyush, was u able to fix issue. Can you explain how you fixed it.

---

<div class="post-metadata">

**Author:** ![Peeyush2019](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/peeyush2019/32/3300_2.png) [@Peeyush2019](https://discuss.kubernetes.io/u/Peeyush2019)\
**Post date:** [September 3, 2019, 4:50am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/3 "2019-09-03T04:50:27Z")

</div>

I was not able to fix it. I tried some approach. None of them worked. At last, I have to reinstall Kubernetes on both the VMs.

---

<div class="post-metadata">

**Author:** ![skyuuka](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/skyuuka/32/3692_2.png) [@skyuuka](https://discuss.kubernetes.io/u/skyuuka)\
**Post date:** [September 26, 2019, 1:12am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/4 "2019-09-26T01:12:11Z")

</div>

I have the same issue to re-join a node after drain it. Any idea why this happens?

---

<div class="post-metadata">

**Author:** ![anhdudeptrai98](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/anhdudeptrai98/32/3993_2.png) [@anhdudeptrai98](https://discuss.kubernetes.io/u/anhdudeptrai98)\
**Post date:** [October 30, 2019, 2:15am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/5 "2019-10-30T02:15:01Z")

</div>

Use “kubeadm token create” on the master node to create a new valid token. Try again.

---

<div class="post-metadata">

**Author:** ![tony\_dad](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/tony_dad/32/4029_2.png) [@tony\_dad](https://discuss.kubernetes.io/u/tony_dad)\
**Post date:** [November 7, 2019, 8:30am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/6 "2019-11-07T08:30:54Z")

</div>

I’ve got the same problem and solved like this.  
Basically I created a new token in ‘kube-master’ and rejoined using the new ‘token’ and ‘hash’ value in ‘kube-node2’.

## kube-master

[root@kube-master ~]# kubectl drain kube-node2 --ignore-daemonsets --delete-local-data  
node/kube-node2 already cordoned  
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-vl4cl, kube-system/kube-proxy-7phrj  
node/kube-node2 drained  
[root@kube-master ~]# kubectl get nodes  
NAME STATUS ROLES AGE VERSION  
kube-master Ready master 18d v1.16.2  
kube-node1 Ready 18d v1.16.2  
kube-node2 NotReady,SchedulingDisabled 18d v1.16.2  
[root@kube-master ~]# kubectl delete node kube-node2  
node “kube-node2” deleted  
[root@kube-master ~]# kubectl get nodes  
NAME STATUS ROLES AGE VERSION  
kube-master Ready master 18d v1.16.2  
kube-node1 Ready 18d v1.16.2  
[root@kube-master ~]#

## kube-node2

[root@kube-node2 ~]# kubeadm reset  
[root@kube-node2 ~]# kubeadm join 192.168.56.2:6443 --token 8hbube.3ovvd50qotfnb8un --discovery-token-ca-cert-hash sha256:5340ec383b25e0c52736970727c4a6f4c8b4ace09c023e1e9e9d26eb037fa9fe  
[preflight] Running pre-flight checks  
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at [https://kubernetes.io/docs/setup/cri/](https://kubernetes.io/docs/setup/cri/)  
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.4. Latest validated version: 18.09

error execution phase preflight: couldn’t validate the identity of the API Server: abort connecting to API servers after timeout of 5m0s  
To see the stack trace of this error execute with --v=5 or higher  
[root@kube-node2 ~]#  
\<== HANG

## kube-master

[root@kube-master ~]# kubeadm token create  
zfvcf0.domneur62fwy33mx  
[root@kube-master ~]# kubeadm token list  
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS  
zfvcf0.domneur62fwy33mx 23h 2019-11-08T17:17:44+09:00 authentication,signing system:bootstrappers:kubeadm:default-node-token  
[root@kube-master ~]# openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2\>/dev/null | openssl dgst -sha256 -hex | sed ‘s/^.\* //’  
5340ec383b25e0c52736970727c4a6f4c8b4ace09c023e1e9e9d26eb037fa9fe  
[root@kube-master ~]#

## kube-node2

[root@kube-node2 ~]# kubeadm reset  
[root@kube-node2 ~]# kubeadm join 192.168.56.2:6443 --token zfvcf0.domneur62fwy33mx --discovery-token-ca-cert-hash sha256:5340ec383b25e0c52736970727c4a6f4c8b4ace09c023e1e9e9d26eb037fa9fe  
[preflight] Running pre-flight checks  
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at [https://kubernetes.io/docs/setup/cri/](https://kubernetes.io/docs/setup/cri/)  
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.4. Latest validated version: 18.09  
[preflight] Reading configuration from the cluster…  
[preflight] FYI: You can look at this config file with ‘kubectl -n kube-system get cm kubeadm-config -oyaml’  
[kubelet-start] Downloading configuration for the kubelet from the “kubelet-config-1.16” ConfigMap in the kube-system namespace  
[kubelet-start] Writing kubelet configuration to file “/var/lib/kubelet/config.yaml”  
[kubelet-start] Writing kubelet environment file with flags to file “/var/lib/kubelet/kubeadm-flags.env”  
[kubelet-start] Activating the kubelet service  
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap…

This node has joined the cluster:

- Certificate signing request was sent to apiserver and a response was received.
- The Kubelet was informed of the new secure connection details.

Run ‘kubectl get nodes’ on the control-plane to see this node join the cluster.

[root@kube-node2 ~]#  
\<== SUCCESS

---

<div class="post-metadata">

**Author:** ![Tejas\_Sumbha](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/tejas_sumbha/32/4349_2.png) [@Tejas\_Sumbha](https://discuss.kubernetes.io/u/Tejas_Sumbha)\
**Post date:** [January 5, 2020, 9:04am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/7 "2020-01-05T09:04:40Z")

</div>

add port 6443 on kubrnts master and open it for slaves

---

<div class="post-metadata">

**Author:** ![mikeowen](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@mikeowen](https://discuss.kubernetes.io/u/mikeowen)\
**Post date:** [February 6, 2020, 10:34am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/8 "2020-02-06T10:34:21Z")

</div>

Hi Guys, I got the same issue, but looking below the error message it said “To see the stack trace of this error execute with --v=5 or higher”. I did this and it immediately told me the issue, and how to solve it. In short the issue was one that many people probably get:

- The token being used had expired due to the long time between setting up the original master, and therefore getting the token, and then trying to join the nodes. My actual error along with the suggested fix of ‘Use “kubeadm token create” on the control-plane node to create a new valid token’ was:

* * *

I0206 10:21:00.980188 28423 token.go:191] [discovery] Failed to connect to API Server “10.36.1.184:6443”: token id “v8gyxv” is invalid for this cluster or it has expired. Use “kubeadm token create” on the control-plane node to create a new valid token

* * *

I hope this helps people in the future.

---

<div class="post-metadata">

**Author:** ![Tayo](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Tayo](https://discuss.kubernetes.io/u/Tayo)\
**Post date:** [May 18, 2020, 2:15am UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/9 "2020-05-18T02:15:20Z")

</div>

I edited the master node security group ( it was an AWS ubuntu instance) and added port 6443 and opened it up to 0.0.0.0/0 ( it is my personal account, so security is not required) .  
HTH.

---

<div class="post-metadata">

**Author:** ![khadar\_khan](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/khadar_khan/32/9649_2.png) [@khadar\_khan](https://discuss.kubernetes.io/u/khadar_khan)\
**Post date:** [March 8, 2022, 5:56pm UTC](https://discuss.kubernetes.io/t/not-able-to-join-node-to-master/7123/10 "2022-03-08T17:56:07Z")

</div>

Hi,

I too have same sort of issue.Then what i did is, First we need to install containerd in place of docker runtime.As Kubernetes depricated docker. Then after we need to give port number in all the nodes i.e both in Master and worker same port numbers.In my case for practice i open AllTraffic option in AWS.The i use kubeadm join token.It worked. Pls try this way.
