mirror of
https://github.com/khuedoan/homelab.git
synced 2025-02-03 12:54:54 +07:00
feat(system): upgrade k3s automatically
This commit is contained in:
parent
d18bb02cbf
commit
bd34fa74ab
35
system/system-upgrade/k3s/agent.yaml
Normal file
35
system/system-upgrade/k3s/agent.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: upgrade.cattle.io/v1
|
||||||
|
kind: Plan
|
||||||
|
metadata:
|
||||||
|
name: k3s-agent
|
||||||
|
namespace: system-upgrade
|
||||||
|
labels:
|
||||||
|
k3s-upgrade: agent
|
||||||
|
spec:
|
||||||
|
concurrency: 1
|
||||||
|
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:
|
||||||
|
image: rancher/k3s-upgrade
|
||||||
|
args:
|
||||||
|
- prepare
|
||||||
|
- k3s-server
|
||||||
|
cordon: true
|
||||||
|
drain:
|
||||||
|
force: true
|
||||||
|
skipWaitForDeleteTimeout: 300 # Honor PodDisruptionBudgets
|
||||||
|
upgrade:
|
||||||
|
image: rancher/k3s-upgrade
|
||||||
|
channel: https://update.k3s.io/v1-release/channels/v1.23
|
6
system/system-upgrade/k3s/kustomization.yaml
Normal file
6
system/system-upgrade/k3s/kustomization.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- server.yaml
|
||||||
|
- agent.yaml
|
30
system/system-upgrade/k3s/server.yaml
Normal file
30
system/system-upgrade/k3s/server.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
apiVersion: upgrade.cattle.io/v1
|
||||||
|
kind: Plan
|
||||||
|
metadata:
|
||||||
|
name: k3s-server
|
||||||
|
namespace: system-upgrade
|
||||||
|
labels:
|
||||||
|
k3s-upgrade: server
|
||||||
|
spec:
|
||||||
|
concurrency: 1
|
||||||
|
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
|
||||||
|
drain:
|
||||||
|
force: true
|
||||||
|
skipWaitForDeleteTimeout: 300 # Honor PodDisruptionBudgets
|
||||||
|
upgrade:
|
||||||
|
image: rancher/k3s-upgrade
|
||||||
|
channel: https://update.k3s.io/v1-release/channels/v1.23
|
6
system/system-upgrade/kustomization.yaml
Normal file
6
system/system-upgrade/kustomization.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- https://github.com/rancher/system-upgrade-controller/releases/download/v0.8.1/system-upgrade-controller.yaml
|
||||||
|
- k3s
|
Loading…
Reference in New Issue
Block a user