We need to create a repository to download Kubernetes.
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
We should update the machines before installing so that we can update the repository.
apt-get update -y
Installing all the packages with dependencies:
apt-get install -y docker.io kubelet kubeadm kubectl kubernetes-cni
rm -rf /var/lib/kubelet/*
In order for many container networks to work, the following needs to be enabled on each node.
sysctl net.bridge.bridge-nf-call-iptables=1
The above steps has to be followed in all the nodes.