- Install Container Runtime (Docker) on all the nodes
sudo apt update
sudo apt install -y docker.io
sudo systemctl enable docker.service- Install Kubernetes on all the nodes
sudo apt install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl- On the controller VM, execute:
sudo kubeadm init --pod-network-cidr 192.168.0.0/16- On the controller VM, to set up kubectl for the ubuntu user, run:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config-
On the other nodes execute the
kubeadm joincommand, found at the end of the output ofkubeadm initcommand. -
On the controller, verify that all nodes have joined
kubectl get nodes- On the controller, install Calico from the manifest:
curl https://docs.projectcalico.org/manifests/calico.yaml -O
kubectl apply -f calico.yaml- On the controller, verify that all nodes are ready
kubectl get nodes