feat: add system-upgrade controller and plan k3s plan
This commit is contained in:
parent
8ffff3d196
commit
8d828e2246
7 changed files with 89 additions and 8 deletions
50
k8s/services/system-upgrade/plan.yaml
Normal file
50
k8s/services/system-upgrade/plan.yaml
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# These plans are adapted from work by Dax McDonald (https://github.com/daxmc99) and Hussein Galal (https://github.com/galal-hussein)
|
||||
# in support of Rancher v2 managed k3s upgrades. See Also: https://rancher.com/docs/k3s/latest/en/upgrades/automated/
|
||||
---
|
||||
apiVersion: upgrade.cattle.io/v1
|
||||
kind: Plan
|
||||
metadata:
|
||||
name: k3s-server
|
||||
namespace: system-upgrade
|
||||
labels:
|
||||
k3s-upgrade: server
|
||||
spec:
|
||||
concurrency: 1 # Batch size (roughly maps to maximum number of unschedulable nodes)
|
||||
version: v1.20.11+k3s1
|
||||
nodeSelector:
|
||||
matchExpressions:
|
||||
- {key: k3s-upgrade, operator: Exists}
|
||||
- {key: k3s-upgrade, operator: NotIn, values: ["disabled", "false"]}
|
||||
- {key: k3os.io/mode, operator: DoesNotExist}
|
||||
- {key: node-role.kubernetes.io/control-plane, operator: Exists}
|
||||
serviceAccountName: system-upgrade
|
||||
cordon: true
|
||||
upgrade:
|
||||
image: rancher/k3s-upgrade
|
||||
---
|
||||
apiVersion: upgrade.cattle.io/v1
|
||||
kind: Plan
|
||||
metadata:
|
||||
name: k3s-agent
|
||||
namespace: system-upgrade
|
||||
labels:
|
||||
k3s-upgrade: agent
|
||||
spec:
|
||||
concurrency: 2 # Batch size (roughly maps to maximum number of unschedulable nodes)
|
||||
version: v1.20.11+k3s1
|
||||
nodeSelector:
|
||||
matchExpressions:
|
||||
- {key: k3s-upgrade, operator: Exists}
|
||||
- {key: k3s-upgrade, operator: NotIn, values: ["disabled", "false"]}
|
||||
- {key: k3os.io/mode, operator: DoesNotExist}
|
||||
- {key: node-role.kubernetes.io/control-plane, operator: DoesNotExist}
|
||||
serviceAccountName: system-upgrade
|
||||
prepare:
|
||||
# Defaults to the same "resolved" tag that is used for the `upgrade` container, NOT `latest`
|
||||
image: rancher/k3s-upgrade
|
||||
args: ["prepare", "k3s-server"]
|
||||
drain:
|
||||
force: true
|
||||
skipWaitForDeleteTimeout: 60 # 1.18+ (honor pod disruption budgets up to 60 seconds per pod then moves on)
|
||||
upgrade:
|
||||
image: rancher/k3s-upgrade
|
||||
Loading…
Add table
Add a link
Reference in a new issue