• May 30, 2023
  • 0 views
  • 0 Comments
# take the token that was earlier
kubeadm join 172.30.9.30:6443 --token kce5ji.5r6wis7xaqzkbw2v 
        --discovery-token-ca-cert-hash sha256:06699b8fb404dbddb98614549c499c8002bb1f65bae41e6e61f5dded761ff60e

# if you do not have or remember the token 
# use command below to create new join token:
kubeadm token create --print-join-command

# example new join token below copy and paste into the worker nodes 
kubeadm join 172.30.9.30:6443 --token ssi5ij.4c3dsmg62v9zivg7 
        --discovery-token-ca-cert-hash sha256:b79bb89808e2c64f4e8a81a498eaf1370b7d9dbdc2027d314d0159933f0dff0f


# once server joins the cluster run command 
kubectl get nodes

# example output
root@master1:~# kubectl get nodes
NAME      STATUS   ROLES           AGE   VERSION
master1   Ready    control-plane   8d    v1.27.01
worker1   Ready    <none>          8d    v1.27.01


# list all pods in all namespaces  
root@master1:~# kubectl get pods --all-namespaces
NAMESPACE      NAME                              READY   STATUS    RESTARTS        AGE
kube-flannel   kube-flannel-ds-kmf4n             1/1     Running   2 (46h ago)     8d
kube-flannel   kube-flannel-ds-pspjz             1/1     Running   1 (7d10h ago)   8d
kube-system    coredns-565d847f94-54dct          1/1     Running   1 (7d10h ago)   8d
kube-system    coredns-565d847f94-mxqvn          1/1     Running   1 (7d10h ago)   8d
kube-system    etcd-master1                      1/1     Running   1 (7d10h ago)   8d
kube-system    kube-apiserver-master1            1/1     Running   1 (7d10h ago)   8d
kube-system    kube-controller-manager-master1   1/1     Running   1 (7d10h ago)   8d
kube-system    kube-proxy-hcft7                  1/1     Running   1 (7d10h ago)   8d
kube-system    kube-proxy-hkf88                  1/1     Running   1 (7d10h ago)   8d
kube-system    kube-scheduler-master1            1/1     Running   1 (7d10h ago)   8d