K3s: Upgrade your Traefik ingress controller to version 2

traefik k3s upgrade

2 min read | by Jordi Prats

If you have K3s' system-upgrade-controller installed you might have noticed how charts appear under /var/lib/rancher/k3s/server/static/charts but your traefik Ingress controller is not being updated:

# pwd
/var/lib/rancher/k3s/server/static/charts
# ls -lrt
total 104
-rw------- 1 root root 27292 May 21  2021 traefik-1.81.0.tgz
-rw------- 1 root root   914 Nov 21 17:19 traefik-crd-9.18.2.tgz
-rw------- 1 root root 17008 Nov 21 17:19 traefik-9.18.2.tgz
-rw------- 1 root root   914 Dec  3 07:14 traefik-crd-9.18.201.tgz
-rw------- 1 root root 17041 Dec  3 07:14 traefik-9.18.201.tgz
-rw------- 1 root root 17685 Dec 22 19:07 traefik-10.3.001.tgz
-rw------- 1 root root  7396 Dec 22 19:07 traefik-crd-10.3.001.tgz

Documentation on k3s updates is really slim but what we can easily realize is that the manifest located on /var/lib/rancher/k3s/server/manifests are not being updated. To update them we can check the appropriate K3s version on it's github repository for the default yaml file that is being shipped with K3s to update it.

Once it is updated with the proper chart version and settings we can either restart k3s:

systemctl restart k3s

Or manually apply the HelmChart object using kubectl apply:

# kubectl apply -f /var/lib/rancher/k3s/server/manifests/traefik.yaml

Either way, the helm operator will take care of installing the traekif ingress controller


Posted on 27/12/2021