Skip to main content

k3s Updates

k3s is the Kubernetes distribution used by AHD VM.

k3s version updates are not automatic and have to be performed by whoever is managing the AHD VM instance.

Thankfully, k3s updates are quick, easy to do and (most of the times) do not require downtime.

warning

Kubernetes does not support upgrading more than one minor version at the time. (i.e. 1.28 -> 1.29 is ok, 1.27 -> 1.29 is NOT ok)

You must always update k3s one minor version at the time, until you reach your desired version.

To update k3s, substitute the INSTALL_K3S_VERSION value with the version you want to update to and run the following command:

curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=<INSERT K3S VERSION HERE> K3S_KUBECONFIG_MODE="644" sh -

For example, to update to k3s version v1.30.0+k3s1:

curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.30.0+k3s1 K3S_KUBECONFIG_MODE="644" sh -

You can find available k3s versions in the k3s official documentation (make sure to check the sidebar) or in the k3s release channel data (look at the k3s version listed in the 'stable' channel).

To verify that the update has taken place, run:

kubectl version

The output should tell you the new kubernets Client (kubectl) and Server versions.

info

If there's a newer version of k3s-selinux to be installed, you need to reboot AHD VM for the update to take place.

You can tell by a mismatching k3s Client and Server version when running the command above, for example:

Client Version: v1.30.0+k3s1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.5+k3s1

After rebooting, run the command again to verify that the K3S Server is running the desired version.