3. Build a new cluster

On all nodes, set up containerd. You will need to load some kernel modules and modify some system settings as part of this process.

cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF

sudo modprobe overlay

sudo modprobe br_netfilter

cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables  = 1
net.ipv4.ip_forward                 = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF

sudo sysctl --system

Install and configure containerd.

sudo apt-get update && sudo apt-get install -y containerd

sudo mkdir -p /etc/containerd

sudo containerd config default | sudo tee /etc/containerd/config.toml

sudo systemctl restart containerd

On all nodes, disable swap.

On all nodes, install kubeadm, kubelet, and kubectl.

On the control plane node only, initialize the cluster and set up kubectl access.

Verify the cluster is working.

Install the Calico network add-on.

Check the calico-related kube-system Pods to verify that everything is working so far (they may take a few moments to fully start up).

Get the join command (this command is also printed during kubeadm init. Feel free to simply copy it from there).

Copy the join command from the control plane node. Run it on each worker node as root (i.e. with sudo).

On the control plane node, verify all nodes in your cluster are ready. Note that it may take a few moments for all of the nodes to enter the READY state.

Last updated