This steps will be execute on the Master Node if not otherwise mentioned.
- Disable swap
sudo swapoff -a
- Comment swap line in /etc/fstab
- Follow Pre-Steps in https://kubernetes.io/docs/setup/production-environment/container-runtimes/
- Install containerd manual https://github.com/containerd/containerd/blob/main/docs/getting-started.md https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd
- Create default config
sudo mkdir /etc/containerd
sudo su -
containerd config default > /etc/containerd/config.toml
exit
sudo systemctl restart containerd
- Update config
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
...
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
- Restart containerd
sudo systemctl restart containerd
- Create missing directory
sudo mkdir /etc/apt/keyrings
By default kubernetes 1.26+ will use systemd as cgroup
- Save the join command statement securley. You will need it later for joining the Worker Nodes
Repeat all steps above for the nodes except the "kubadm init". Once you have finished the steps run the join command.
kubeadm join <masterip>:6443 --token <token> --discovery-token-ca-cert-hash <discoverytoken>
If you secured the join command in step Install Kubernetes all fields are prefilled.
In this instruction we are using calico. Run the following commands on master:
curl https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml -O
kubectl apply -f calico.yaml
Ref. (https://docs.tigera.io/calico/3.25/getting-started/kubernetes/self-managed-onprem/onpremises) After a minute verify that your cluster is up and running.
kubectl get nodes
Output:
NAME STATUS ROLES AGE VERSION
kmaster Ready control-plane 20h v1.26.2
knode01 Ready <none> 20h v1.26.2
knode02 Ready <none> 20h v1.26.2