fix: improve talos taskfile and add upgrade docs to README.md

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-05-31 08:23:32 -04:00
1 parent 77c112bc7a
commit 67ed0a4f19
2 files changed
+38 -9

No files matched your search

+16 -5
View File
@@ -7,9 +7,10 @@ vars:
TALHELPER_SECRET_FILE: "{{.KUBERNETES_DIR}}/bootstrap/talos/talsecret.sops.yaml"
TALHELPER_CONFIG_FILE: "{{.KUBERNETES_DIR}}/bootstrap/talos/talconfig.yaml"
HELMFILE_FILE: "{{.KUBERNETES_DIR}}/bootstrap/helmfile.yaml"
TALOSCONFIG_FILE: "{{.TALHELPER_CLUSTER_DIR}}/talosconfig"
env:
TALOSCONFIG: "{{.TALHELPER_CLUSTER_DIR}}/talosconfig"
TALOSCONFIG: "{{.TALOSCONFIG_FILE}}"
tasks:
@@ -54,14 +55,20 @@ tasks:
- msg: Missing helmfile
sh: test -f {{.HELMFILE_FILE}}
upgrade-talos:
upgrade:
desc: Upgrade talos on a node
cmd: talosctl --nodes {{.node}} upgrade --image {{.image}} --preserve=true --reboot-mode=default
cmd: talosctl --nodes {{.node}} upgrade --image {{.image}} --preserve=true --reboot-mode={{.mode}}
vars:
mode: '{{.mode | default "default"}}'
requires:
vars: ["node", "image"]
preconditions:
- msg: Missing talosconfig
sh: test -f {{.TALOSCONFIG_FILE}}
- msg: Unable to retrieve Talos config
sh: talosctl config info >/dev/null 2>&1
- msg: Node not found
sh: talosctl --nodes {{.node}} get machineconfig
sh: talosctl --nodes {{.node}} get machineconfig >/dev/null 2>&1
upgrade-k8s:
desc: Upgrade k8s on a node
@@ -69,8 +76,12 @@ tasks:
requires:
vars: ["node", "to"]
preconditions:
- msg: Missing talosconfig
sh: test -f {{.TALOSCONFIG_FILE}}
- msg: Unable to retrieve Talos config
sh: talosctl config info >/dev/null 2>&1
- msg: Node not found
sh: talosctl --nodes {{.node}} get machineconfig
sh: talosctl --nodes {{.node}} get machineconfig >/dev/null 2>&1
nuke:
desc: Resets nodes back to maintenance mode