Recommended way to upgrade k3s?

Hello everyone.

I have a working k3s cluster using NixOS 22.05. Now of course I need to upgrade to NixOS 22.11. However, I want to follow recommended upgrade instructions.

Before we begin, to understand the problem, I think it’s important to have a look at Version Skew Policy | Kubernetes

Summarizing, to have a successful cluster upgrade, you need to:

  1. Upgrade your server nodes to the latest patch version available. One node at a time.
  2. Do the same operation with worker nodes, in no particular order.
  3. Repeat steps 1-2, but this time upgrading to the latest patch version in the next minor version.
  4. Repeat step 3 until reached the desired minor version.

Which, in this particular context, and bearing in mind current releases as of today, translates to:

  1. Upgrade servers to Release v1.23.14+k3s1 · k3s-io/k3s · GitHub
  2. Upgrade workers to that version.
  3. Upgrade servers to Release v1.24.8+k3s1 · k3s-io/k3s · GitHub
  4. Upgrade workers to that version.
  5. Upgrade servers to Release v1.25.4+k3s1 · k3s-io/k3s · GitHub
  6. Upgrade workers to that version.

However, latest k3s in NixOS 22.05 is 1.23.10+k3s1 and in Nixos 22.11 is 1.25.3+k3s1. There’s no 1.24.x version available AFAICS.

So I’m a bit puzzled. How am I supposed to apply recommended upgrade methods using NixOS? Since k3s is such a specific piece, would it make sense to have a separate repo that packages all releases for NixOS, so it can be overlaid on any version?

Thanks!

I’m in a similar situation, did you find any way forward @Yajo ?

These days it changed quite a bit.

Now, all currently-supported k3s minor versions are packaged separately and updated in unstable.

IIRC since next nixos releases, it will ship only with the newest one, and efforts are done to keep at least one common version between the previous nixos release and the new one.

2 Likes