K3s traefik 1.8 to 2.x

Hi all,

I’ve a running k3s cluster with 3 master and 3 node.
The cluster is working without problems with the default k3s configuration and traefik 1.8.

Now I want migrate traefik from 1.x to 2.x without recreate the cluster.
There is a guide to do that?

Thansk in advanced

Just curious, why without recreating the cluster ?

If that’s because you would experience some downtime that you cannot tolerate, have you considered creating a HA setup or perhaps following a blue-green cutover for your cluster. IMHO you should consider clusters as entirely disposable and that includes every node and workload within them (system or otherwise). It’s really not that difficult to create high resilience and that feature will serve you well, not only when you need to swap out or upgrade a core component, but also in the normal and expected issues that occur with any non trivial deployment.

The step to recreate the cluster is:

  1. run the uninstall.sh script to remove all service and data
  2. reinstall the cluster

It’s right?

Installing the new version of k3s it comming with the new traefik version?

Hi there,

Yes the k3s-uninstall.sh but is suggest at least backup the /var/lib/rancher/k3s/server/db/ if you are using the etcd. With the fresh cluster traefik v2 comes since K3s versions 1.21.

I (Noob) was also stumbling on the same question. When i consider my cluster as disposable i wonder how people are handling the following things.

  • I have several helm installed services
  • I have persistent storage

For the cluster setup i use ansible, but only for the installation of k3s, do you think this is a good idea to use ansible to setup the helm packages as well?

As for the persistent storage, i am a bit lost. How are you guys do it, do you create your pv and pvc before (by hand) and then reference in the helm packages (most of them can)?

Yours,
bbk

What i did to get traefik v2 in the existing cluster:

  • Installed the k3s version where v2 is default
  • removed traefik kubectl -n kube-system delete helmcharts.helm.cattle.io traefik
  • removed some remaining traefik container
  • wait till k3s will redeploy traefik (in v2)