system-upgrade-controller

by lexfrei

Helm chartv0.2.16App v0.21.1BSD-3-ClauseVerified publisher

Kubernetes-native upgrade controller for nodes using declarative Plans

About this chart

system-upgrade-controller

📊 Status & Metrics

Kubernetes-native upgrade controller for nodes using declarative Plans

Homepage: https://github.com/lexfrei/charts/

Maintainers

NameEmailUrl
lexfrei[email protected]https://github.com/lexfrei

Source Code

Requirements

Kubernetes: >=1.16.0-0

Introduction

This chart deploys the Rancher System Upgrade Controller on a Kubernetes cluster using the Helm package manager. The System Upgrade Controller is a Kubernetes-native upgrade controller that enables automated upgrades of cluster nodes through declarative Plans.

Features

  • Declarative node upgrade plans using Custom Resource Definitions (CRDs)
  • Automated rolling upgrades with configurable concurrency
  • Node drain and cordon support
  • Suitable for k3s, RKE2, and other Kubernetes distributions
  • Highly configurable job parameters
  • Full RBAC support

Installing the Chart

From OCI Registry (GHCR)

This chart is published to GitHub Container Registry as an OCI artifact.

# Install latest version
helm install system-upgrade-controller \
  oci://ghcr.io/lexfrei/charts/system-upgrade-controller

# Install specific version
helm install system-upgrade-controller \
  oci://ghcr.io/lexfrei/charts/system-upgrade-controller \
  --version 0.1.0

# Install with custom values
helm install system-upgrade-controller \
  oci://ghcr.io/lexfrei/charts/system-upgrade-controller \
  --version 0.1.0 \
  --values custom-values.yaml

Chart Verification

This chart is signed with cosign using keyless signing. Verify the signature before installation:

cosign verify \
  ghcr.io/lexfrei/charts/system-upgrade-controller:0.1.2 \
  --certificate-identity "https://github.com/lexfrei/charts/.github/workflows/publish-oci.yaml@refs/heads/master" \
  --certificate-oidc-issuer "https://token.actions.githubusercontent.com"

The signature is stored in the Rekor transparency log for public verification.

Uninstalling the Chart

helm delete system-upgrade-controller

Values

KeyTypeDefaultDescription
affinityobject{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"node-role.kubernetes.io/control-plane","operator":"Exists"},{"key":"kubernetes.io/os","operator":"In","values":["linux"]}]}]}},"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["system-upgrade-controller"]}]},"topologyKey":"kubernetes.io/hostname"}]}}Affinity for the controller deployment
controllerobject{"debug":false,"leaderElect":true,"name":"system-upgrade-controller","threads":2}Controller configuration
controller.debugboolfalseEnable debug logging
controller.leaderElectbooltrueEnable leader election
controller.namestring"system-upgrade-controller"Controller name (from metadata labels)
controller.threadsint2Number of threads for the controller
crdobject{"install":true}CRD installation
crd.installbooltrueInstall the CRD (Plans)
fullnameOverridestring""
imageobject{"pullPolicy":"IfNotPresent","repository":"rancher/system-upgrade-controller","tag":""}Image configuration
image.tagstring""Overrides the image tag whose default is the chart appVersion
imagePullSecretslist[]
jobobject{"activeDeadlineSeconds":900,"backoffLimit":99,"imagePullPolicy":"Always","kubectlImage":"rancher/kubectl:v1.36.2","privileged":true,"ttlSecondsAfterFinish":900}Job configuration for upgrade plans
job.activeDeadlineSecondsint900Active deadline seconds for jobs
job.backoffLimitint99Backoff limit for job failures
job.imagePullPolicystring"Always"Image pull policy for upgrade jobs
job.kubectlImagestring"rancher/kubectl:v1.36.2"kubectl image for upgrade jobs
job.privilegedbooltrueRun upgrade jobs as privileged
job.ttlSecondsAfterFinishint900TTL seconds after job finish
nameOverridestring""
namespaceobject{"create":true,"name":"system-upgrade"}Namespace where the controller will be deployed
namespace.createbooltrueCreate the namespace
namespace.namestring"system-upgrade"Name of the namespace
networkPolicyobject{"egress":[],"enabled":false,"ingress":[]}Network Policy configuration
networkPolicy.egresslist[]Additional egress rules
networkPolicy.enabledboolfalseEnable NetworkPolicy
networkPolicy.ingresslist[]Additional ingress rules
nodeSelectorobject{}Node selector for the controller deployment
planobject{"pollingInterval":"15m"}Plan polling configuration
plan.pollingIntervalstring"15m"Polling interval for checking plan updates
podAnnotationsobject{}Pod annotations
podLabelsobject{}Pod labels
podSecurityContextobject{"runAsGroup":65534,"runAsNonRoot":true,"runAsUser":65534}Security context for the pod
resourcesobject{}Resource limits and requests
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"seccompProfile":{"type":"RuntimeDefault"}}Security context for the container
serviceAccountobject{"annotations":{},"create":true,"name":"system-upgrade"}Service account configuration
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring"system-upgrade"The name of the service account to use
tolerationslist[{"key":"CriticalAddonsOnly","operator":"Exists"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/master","operator":"Exists"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/controlplane","operator":"Exists"},{"effect":"NoSchedule","key":"node-role.kubernetes.io/control-plane","operator":"Exists"},{"effect":"NoExecute","key":"node-role.kubernetes.io/etcd","operator":"Exists"}]Tolerations for the controller deployment

Example Configurations

Basic k3s Upgrade Plan

After installing the controller, create a Plan to upgrade k3s:

apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: k3s-server
  namespace: system-upgrade
spec:
  concurrency: 1
  cordon: true
  nodeSelector:
    matchExpressions:
      - key: node-role.kubernetes.io/control-plane
        operator: Exists
  serviceAccountName: system-upgrade
  upgrade:
    image: rancher/k3s-upgrade
  version: v1.28.5+k3s1

Custom Namespace

namespace:
  name: my-upgrade-namespace
  create: true

Increased Job Timeout

job:
  activeDeadlineSeconds: 1800  # 30 minutes
  ttlSecondsAfterFinish: 1800

Debug Mode

controller:
  debug: true

Disable CRD Installation

If CRDs are managed separately:

crd:
  install: false

Configuration and Installation Details

RBAC

The chart creates the following RBAC resources:

  • ClusterRole for controller operations
  • ClusterRole for node draining operations
  • Role for namespace-scoped job management
  • Corresponding bindings for the service account

Security

The controller runs with a restricted security context:

  • Non-root user (UID 65534)
  • No privilege escalation
  • All capabilities dropped
  • RuntimeDefault seccomp profile

Affinity and Tolerations

By default, the controller is configured to run on control-plane nodes with appropriate tolerations and pod anti-affinity rules.

Upgrading the Chart

# Upgrade to latest version
helm upgrade system-upgrade-controller \
  oci://ghcr.io/lexfrei/charts/system-upgrade-controller

# Upgrade to specific version
helm upgrade system-upgrade-controller \
  oci://ghcr.io/lexfrei/charts/system-upgrade-controller \
  --version 0.2.0

Resources


Autogenerated from chart metadata using helm-docs v1.14.2

Deploy system-upgrade-controller with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has system-upgrade-controller on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsystem-upgrade-controller is pinned at v0.2.16 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply