Ubuntu is a very suitable distribution to run kubernetes because we have an up to date kernel with up to date features and packages are available widely.
Running kubernetes on Ubuntu is straight forward - except it requires packages that are newer than the upstream provides. This is the case on Kubernetes 1.26. As kubernetes 1.26 finally removes v1alpha2 CRI API it requires containerd >= 1.6.
Get containerd 1.6 on Ubuntu 22.04
The regular ubuntu upstream mirrors provide (as of today) containerd with version 1.5 but not yet 1.6.
A suitable and trusted source for more recent builds of containerd is the use of a docker repository (which does not mean that we will install docker).
Removal of containerd
Before installing containerd from docker we need to remove containerd in it's current installation. The reason is that ubuntu upstream calls the package containerd whereas docker distributes it as containerd.io.
Install containerd from docker repo
The installation is straight forward:
It's also important to note that we provide a configuration file for containerd & restart the daemon afterwards. Otherwise the socket will not provide the appropriate response to kubeadm.
Adjust cgroup if required
It might happen (probably on new installations) that your pods keep crashing, especially noticable on etcd. This might depend on the cgroup driver you want to use. On ubuntu we're using systemd for this. To get it running, make an adjustment on the /etc/containerd/config.toml and enable the SystemdCgroup driver.
Source is here:
That's all you need - have fun with kubernetes 1.26.