Joining new node to kubernetes cluster

First way-

n00πŸ”‘
Nov 25, 2022

Note: you need to run all these commands on master/control plane node.

  1. 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!

--

--