Joining new node to kubernetes cluster
Note: you need to run all these commands on master/control plane node.
- Finding token-
kubeadm token list
β749p22.f2342qewnc6zu1ccβ
2. Finding the CA cert hash-
openssl x509 -pubkey -in /etc/kubernetes/pki/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
β9dbced71cc46c36d03515ee23d21d9dad06bd1d0fa2e89ecc9f13d057e3c42e3β
3. IP address of control plane/master node-
ip a
β172.16.94.10β
4. Joining new node(run this on new node to be joined)-
kubeadm join 172.16.94.10:6443 --token 749p22.f2342qewnc6zu1cc --discovery-token-ca-cert-hash sha256:9dbced71cc46c36d03515ee23d21d9dad06bd1d0fa2e89ecc9f13d057e3c42e3
Second way-
This command automatically generates the node join command.
kubeadm token create --print-join-command
Thanks for reading!