25.6.8 Communication Between the Kubernetes Master Node and Worker Node Fails

This issue can occur if you revert the master node. However, the worker nodes still assume the connection with the old master node.

Workaround:

  1. Run the following command to retrieve a token from the master node:

    //get token - kubeadm token create --print-join-command

  2. Remove the following files from the worker nodes:

    • ca.crt

      // sudo rm /etc/kubernetes/pki/ca.crt

    • kubelet.conf

      // sudo rm /etc/kubernetes/kubelet.conf

  3. Delete the worker nodes:

    1. Run commands:

      kubectl drain <name-of-the-node> --ignore-daemonsets

      kubectl delete node <name-of-the-node>

    2. Repeat the previous step for all the nodes.

  4. Connect the master node with the worker nodes:

    // kubeadm join <master-node-IP>:6443 --token n5hxyu.v0wzsc0zk9rosohw --discovery-token-ca-cert-hash sha256:4e891f83f3aaa75832d8a955e25ed50111d6bc3b26146180e2c4d48f9fa5556d