From 1c038843ed5e2e7e228984e25683396230804f0f Mon Sep 17 00:00:00 2001 From: Jean-Francois Roy Date: Wed, 25 Dec 2024 20:28:36 -0800 Subject: [PATCH] feat(suc): use tmu for talos upgrades --- .../plans/kustomization.yaml | 7 ++-- .../plans/talos.yaml | 42 +++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 kubernetes/apps/talos-admin/system-upgrade-controller/plans/talos.yaml diff --git a/kubernetes/apps/talos-admin/system-upgrade-controller/plans/kustomization.yaml b/kubernetes/apps/talos-admin/system-upgrade-controller/plans/kustomization.yaml index a9430a82a..c8e15a91e 100644 --- a/kubernetes/apps/talos-admin/system-upgrade-controller/plans/kustomization.yaml +++ b/kubernetes/apps/talos-admin/system-upgrade-controller/plans/kustomization.yaml @@ -4,6 +4,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./kubernetes.yaml - - ./talos-etincelle-s1.yaml - - ./talos-etincelle-s2.yaml - - ./talos-siderolabs-minimal.yaml + - ./talos.yaml + # - ./talos-etincelle-s1.yaml + # - ./talos-etincelle-s2.yaml + # - ./talos-siderolabs-minimal.yaml diff --git a/kubernetes/apps/talos-admin/system-upgrade-controller/plans/talos.yaml b/kubernetes/apps/talos-admin/system-upgrade-controller/plans/talos.yaml new file mode 100644 index 000000000..d2f6e7466 --- /dev/null +++ b/kubernetes/apps/talos-admin/system-upgrade-controller/plans/talos.yaml @@ -0,0 +1,42 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/upgrade.cattle.io/plan_v1.json +apiVersion: upgrade.cattle.io/v1 +kind: Plan +metadata: + name: talos +spec: + version: ${TALOS_VERSION} + serviceAccountName: system-upgrade + secrets: + - name: talos + path: /var/run/secrets/talos.dev + ignoreUpdates: true + concurrency: 1 + exclusive: true + nodeSelector: + matchExpressions: + - key: feature.node.kubernetes.io/system-os_release.ID + operator: In + values: ["talos"] + - key: feature.node.kubernetes.io/system-os_release.VERSION_ID + operator: NotIn + values: ["${TALOS_VERSION}"] + tolerations: + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + prepare: &prepare + image: ghcr.io/jfroy/siderolabs/talosctl:${TALOS_VERSION} + envs: + - name: NODE_IP + valueFrom: + fieldRef: + fieldPath: status.hostIP + args: + - --nodes=$(NODE_IP) + - health + - --server=false + upgrade: + image: ghcr.io/jfroy/tnu:latest + args: + - $(SYSTEM_UPGRADE_PLAN_LATEST_VERSION)