part 4: Join nodes to cluster
On Control plane run command below on masterNode(192.168.1.50); copy the output and run on the worker nodes.
kubeadm token create --print-join-command
@masterNode:~$ sudo kubeadm token create --print-join-command
kubeadm join 192.168.1.50:6443 --token owm6ux.a3xr3xxxjr --discovery-token-ca-cert-hash sha256:d11bcbf5a51bb8fde4c7b641xxx3
On NodeA
root@nodeA:/cri# kubeadm join 192.168.1.50:6443 --token t19nrh.iarj8ucfo810o8be --discovery-token-ca-cert-hash sha256:d11bcbf5a51bb8fde4c7b6412b2afb033ae312d8ab51c9d3b9fa24cb112e0f63 [preflight] Running pre-flight checks [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml' [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] Starting the kubelet [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.
similarly run the same on NodeB
kubectl get pod -A -o wide
# get pod on all name space
ubuntu@masterNode:~$ kubectl get pods -A -o wide
kubectl get pods -A -o wide
NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
kube-flannel kube-flannel-ds-86tsz 1/1 Running 1 (13h ago) 23h 192.168.1.95 nodea <none> <none>
kube-flannel kube-flannel-ds-q5wxp 1/1 Running 7 (13h ago) 24h 192.168.1.50 nodeb <none> <none>
kube-flannel kube-flannel-ds-t22jk 1/1 Running 7 (13h ago) 24h 192.168.1.111 master1 <none> <none>
kube-system coredns-5dd5756b68-rxr99 1/1 Running 1 (13h ago) 2d12h 10.244.0.4 master1 <none> <none>
kube-system coredns-5dd5756b68-thcrg 1/1 Running 1 (13h ago) 2d12h 10.244.0.5 master1 <none> <none>
kube-system etcd-ubuntu1 1/1 Running 9 (13h ago) 2d12h 192.168.1.111 master1 <none> <none>
kube-system kube-apiserver-ubuntu1 1/1 Running 9 (13h ago) 2d12h 192.168.1.111 master1 <none> <none>
kube-system kube-controller-manager-ubuntu1 1/1 Running 11 (13h ago) 2d12h 192.168.1.111 master1 <none> <none>
kube-system kube-proxy-2nrbt 1/1 Running 1 (13h ago) 23h 192.168.1.95 nodea <none> <none>
kube-system kube-proxy-mplfj 1/1 Running 1 (13h ago) 2d12h 192.168.1.111 master1 <none> <none>
kube-system kube-proxy-sgqdp 1/1 Running 1 (13h ago) 26h 192.168.1.50 nodeb <none> <none>
kube-system kube-scheduler-ubuntu1 1/1 Running 9 (13h ago) 2d12h 192.168.1.111 master1 <none> <none>
possible issue/solutions after joining cluster - check part 1