root@k3s-node-01:~# kubectl create namespace system-upgrade
namespace/system-upgrade created
root@k3s-node-01:~#
root@k3s-node-01:~# kubectl apply -f https://github.com/rancher/system-upgrade-controller/releases/latest/download/system-upgrade-controller.yaml
Warning: resource namespaces/system-upgrade is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
namespace/system-upgrade configured
serviceaccount/system-upgrade created
role.rbac.authorization.k8s.io/system-upgrade-controller created
clusterrole.rbac.authorization.k8s.io/system-upgrade-controller created
clusterrole.rbac.authorization.k8s.io/system-upgrade-controller-drainer created
rolebinding.rbac.authorization.k8s.io/system-upgrade created
clusterrolebinding.rbac.authorization.k8s.io/system-upgrade created
clusterrolebinding.rbac.authorization.k8s.io/system-upgrade-drainer created
configmap/default-controller-env created
deployment.apps/system-upgrade-controller created
root@k3s-node-01:~#
root@k3s-node-01:~# kubectl apply -f https://github.com/rancher/system-upgrade-controller/releases/latest/download/crd.yaml
customresourcedefinition.apiextensions.k8s.io/plans.upgrade.cattle.io created
root@k3s-node-01:~#
root@k3s-node-01:~# nano upgrade-k3s.yml
root@k3s-node-01:~#
root@k3s-node-01:~# cat upgrade-k3s.yml
# Server plan
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: server-plan
  namespace: system-upgrade
spec:
  concurrency: 1
  cordon: true
  nodeSelector:
    matchExpressions:
    - key: node-role.kubernetes.io/control-plane
      operator: In
      values:
      - "true"
  serviceAccountName: system-upgrade
  upgrade:
    image: rancher/k3s-upgrade
  version: v1.30.6+k3s1
---
# Agent plan
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: agent-plan
  namespace: system-upgrade
spec:
  concurrency: 1
  cordon: true
  nodeSelector:
    matchExpressions:
    - key: node-role.kubernetes.io/control-plane
      operator: DoesNotExist
  prepare:
    args:
    - prepare
    - server-plan
    image: rancher/k3s-upgrade
  serviceAccountName: system-upgrade
  upgrade:
    image: rancher/k3s-upgrade
  version: v1.30.6+k3s1
root@k3s-node-01:~#

root@k3s-node-01:~# kubectl apply -f upgrade-k3s.yml
plan.upgrade.cattle.io/server-plan created
plan.upgrade.cattle.io/agent-plan created
root@k3s-node-01:~#

Leave a Reply

Your email address will not be published. Required fields are marked *