Skip to content

system-upgrade

Introduction

Rancher's system-upgrade-controller makes it easy to upgrade K3s nodes in an automated way. It introduces a CustomResourceDefinition named Plan to provide details about an update of a selected range of nodes:

Example of kind Plan

Plan/system-upgrade/master
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: master
  namespace: system-upgrade
spec:
  # renovate: datasource=github-releases depName=k3s-io/k3s (1)
  version: "v1.30.1+k3s1"
  serviceAccountName: system-upgrade
  concurrency: 1
  cordon: true
  nodeSelector:
    matchExpressions:
      # only control-plane nodes (2)
      - key: node-role.kubernetes.io/control-plane
        operator: Exists
  tolerations:
    - key: node-role.kubernetes.io/control-plane
      operator: Exists
      effect: NoSchedule
  upgrade:
    image: rancher/k3s-upgrade
  1. You can use Renovate Bot to automate upgrades of K3s using plans
  2. Labels and selectors are used to differentiate between control-plane nodes and worker ones

The controller then picks up any Plan resource and performs the defined upgrades accordingly inside the cluster. For more information you can check out the official K3s docs or the GitHub Repository.

Created Resources

Kind Name
Namespace system-upgrade
Plan master, worker