Note
Login on https://labs.play-with-k8s.com/ and follow below steps
kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
kubeadm token create --print-join-command
Important
Every worker node must have kubelet installed and running as a system service. Please install kubelet on the target node before executing the join command.
sudo apt install kubeadm kubelet kubectl # optional for listed playground as it comes with pre-installed
kubeadm join 192.168.0.8:6443 --token c2ioq4.hy4ysw7ipf8a9svf --discovery-token-ca-cert-hash sha256:d507dc03285b97e1442dff82c07c7c623b4ac3d73379ca0cd954128a67f58423
kubectl get nodes
kubectl get pods --field-selector spec.nodeName=node2
kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml
Note
List and verify the pods on both node1(master) and node2(worker) Pods should be running on worker nodes only
kubectl get pods -n kube-system
kubectl get pods -n kube-system --field-selector spec.nodeName=node2