1. Master & Worker(Latest) :
==================================================================================
==
sudo apt-get update
//GPG key for Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
//Docker Repository
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable"
//GPG key for Kubernetes
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
//Kubernetes repository
cat << EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
//Update the repositiries
sudo apt-get update
//Install Docker and Kubernetes packages
sudo apt-get install -y docker-ce=5:20.10.7~3-0~ubuntu-$(lsb_release -cs) kubelet=1.21.1-00
kubeadm=1.21.1-00 kubectl=1.21.1-00
//Hold the versions
sudo apt-mark hold docker-ce kubelet kubeadm kubectl
//Enable the iptables bridge
echo "net.bridge.bridge-nf-call-iptables=1" | sudo tee -a /etc/sysctl.conf
2. //To make the changes to take immediate effect for the iptables
sudo sysctl -p
Makesure to run above commands on Worker as normal user instead root user
Perform only on Master :
==================================================================================
===
//Calico network
sudo kubeadm init --pod-network-cidr=192.168.0.0/16
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
//To set up the Calico network
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
//Check the nodes
kubectl get nodes
After Master node is ready then join using kubeadm command
use sudo before join command
sudo kubeadm join 10.128.0.9:6443 --token bqpyow.hvzty189tvhzu8ml
--discovery-token-ca-cert-hash
sha256:377ad879fb9cde9f3382b2450f314978b7de7bb38a89093f2c2d2ed882b59656
If we forgot key then how to to retrive that key
kubeadm token create --print-join-command
--------------------------------------------------------------------------------------------------------------------------