feat: add SUC for talos and k3s and move schematics to cluster.nodes.talos

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-01-30 09:10:46 -05:00
1 parent fa689379af
commit 2267494b98
11 files changed
+392 -6

No files matched your search

@@ -0,0 +1,54 @@
{% if distribution in ['k3s'] %}
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: controllers
spec:
# renovate: datasource=github-releases depName=k3s-io/k3s
version: v1.29.0+k3s1
upgrade:
image: rancher/k3s-upgrade
serviceAccountName: system-upgrade
concurrency: 1
cordon: true
nodeSelector:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
tolerations:
- effect: NoSchedule
operator: Exists
- effect: NoExecute
operator: Exists
- key: node-role.kubernetes.io/control-plane
effect: NoSchedule
operator: Exists
- key: node-role.kubernetes.io/master
effect: NoSchedule
operator: Exists
- key: node-role.kubernetes.io/etcd
effect: NoExecute
operator: Exists
- key: CriticalAddonsOnly
operator: Exists
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: workers
spec:
# renovate: datasource=github-releases depName=k3s-io/k3s
version: v1.29.0+k3s1
serviceAccountName: system-upgrade
concurrency: 1
nodeSelector:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: DoesNotExist
prepare:
image: rancher/k3s-upgrade
args: ["prepare", "server"]
upgrade:
image: rancher/k3s-upgrade
{% endif %}
@@ -0,0 +1,11 @@
{% if distribution in ['k3s'] or (distribution in ['talos'] and cluster.nodes.talos.schematics.enabled) %}
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
{% if distribution in ['k3s'] %}
- ./k3s.yaml
{% elif distribution in ['talos'] and cluster.nodes.talos.schematics.enabled %}
- ./talos.yaml
{% endif %}
{% endif %}
@@ -0,0 +1,98 @@
{% if distribution in ['talos'] and cluster.nodes.talos.schematics.enabled %}
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: kubernetes
spec:
# renovate: datasource=docker depName=ghcr.io/siderolabs/kubelet
version: v1.29.1
serviceAccountName: system-upgrade
secrets:
- name: talos
path: /var/run/secrets/talos.dev
ignoreUpdates: true
concurrency: 1
exclusive: true
nodeSelector:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
prepare: &prepare
image: ghcr.io/siderolabs/talosctl:v1.6.3
envs:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
args:
- --nodes=$(NODE_IP)
- health
- --server=false
upgrade:
<<: *prepare
args:
- --nodes=$(NODE_IP)
- upgrade-k8s
- --to=$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
name: talos
spec:
# renovate: datasource=docker depName=ghcr.io/siderolabs/installer
version: v1.6.3
serviceAccountName: system-upgrade
secrets:
- name: talos
path: /var/run/secrets/talos.dev
ignoreUpdates: true
concurrency: 1
cordon: true
drain:
deleteLocalData: true
disableEviction: false
ignoreDaemonSets: true
exclusive: true
nodeSelector:
matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- 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: NoSchedule
- key: node-role.kubernetes.io/etcd
operator: Exists
effect: NoSchedule
prepare: &prepare
image: ghcr.io/siderolabs/talosctl
envs:
- name: NODE_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
args:
- --nodes=$(NODE_IP)
- health
- --server=false
upgrade:
<<: *prepare
args:
- --nodes=$(NODE_IP)
- upgrade
- --image=factory.talos.dev/installer/{{ cluster.nodes.talos.schematics.id }}:$(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)
- --preserve=true
- --wait=false
{% endif %}