At this stage we can choose what container runtime to use. We can use Docker, it is not required any more, but initiatively continues to support Kubernetes. Also we can take a look at containerd, CRI-O, Mirantis. Here is official Kubernetes Documentation page on this topic
In this installation let's use containerd. We have to install it on each virtual machine except HA Proxy. Process is pretty strait forward if you know what you are doing. So let's get into it.
Swap
SSH connect to Master 1 virtual machine:
ssh username|@|master.node.1.ip.address
Install come dependencies, that will be useful for making a cluster. Best text editor in the world is there of course. :)
sudo apt install -y vim apt-transport-https
Next we need to switch of swap volume on virtual machine as this is requirement for Kubernetes nodes.
sudo swapoff -a
And edit fstab file to make changes persistant:
sudo vim /etc/fstab
When editor showed up, press "Shift"+"G" to move cursor at the last line of fstab file. This line should start with "swap...". Then press "d", "d" (twice "d") to delete this line. When line deleted, press ":", "w", "q" to save changes and quit.
Containerd
Now we are ready to install containerd:
sudo apt install containerd -y
Set k8s to load some network modules for bridging traffic. For more details there is official page
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
Next activate these modules by executing:
sudo modprobe overlay && sudo modprobe br_netfilter
Making changes persistent to reboots:
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
And apply setting whith out rebooting machine:
sudo sysctl --system
Fine, we are almost ready to tune containerd config a bit, let's make overriding config:
sudo mkdir /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo vim /etc/containerd/config.toml
Here we need to make these changes:
- Set SystemdCgroup = false to true. To be able to do it, begin typing /Systemd right in vim and it will move cursor right on to necessary line. Press "Shift" + "a" to move cursor to the right and change to isert mode, you will see "---INSERT---" in left bottom corner of the terminal. Change the text, press ESC and ":", "w" and ENTER to save changes.
- Set sandbox_image = "registry.k8s.io/pause:3.8" to sandbox_image = "registry.k8s.io/pause:3.9". Here we need to change just one digit, but it matters. Process is the same like in previous point but here, after editing add also "q" and ENTER to quit after saving.
Finally restart containerd for changes to take effect:
sudo systemctl restart containerd
Be sure you properly have made all these actions on each master and worker machine.
Ok, we are now ready to install Kubernetes 1.28 on machines. We will make in the next part.