Skip to content

Commit

Permalink
fix: improve talos taskfile and add upgrade docs to README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <devin@buhl.casa>
  • Loading branch information
onedr0p committed May 31, 2024
1 parent 67ed0a4 commit d566efb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 8 additions & 6 deletions .taskfiles/Talos/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ tasks:
sh: test -f {{.HELMFILE_FILE}}

upgrade:
desc: Upgrade talos on a node
cmd: talosctl --nodes {{.node}} upgrade --image {{.image}} --preserve=true --reboot-mode={{.mode}}
desc: Upgrade Talos on a node
cmds:
- talosctl --nodes {{.node}} upgrade --image {{.image}} --wait=true --timeout=10m --preserve=true --reboot-mode={{.mode}}
- talosctl --nodes {{.node}} health --wait-timeout=10m --server=false
vars:
mode: '{{.mode | default "default"}}'
requires:
Expand All @@ -71,17 +73,17 @@ tasks:
sh: talosctl --nodes {{.node}} get machineconfig >/dev/null 2>&1

upgrade-k8s:
desc: Upgrade k8s on a node
cmd: talosctl --nodes {{.node}} upgrade-k8s --to {{.to}}
desc: Upgrade Kubernetes across the cluster
cmd: talosctl --nodes {{.controller}} upgrade-k8s --to {{.to}}
requires:
vars: ["node", "to"]
vars: ["controller", "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 >/dev/null 2>&1
sh: talosctl --nodes {{.controller}} get machineconfig >/dev/null 2>&1

nuke:
desc: Resets nodes back to maintenance mode
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,18 @@ Resolving problems that you have could take some tweaking of your YAML manifests

```sh
# Upgrade Talos to a newer version
# NOTE: This needs to be run once on every node
task talos:upgrade node=? image=?
# e.g.
# task talos:upgrade node=192.168.42.10 image=factory.talos.dev/installer/${schematic_id}:v1.7.4
```

```sh
# Upgrade Kubernetes to a newer version
task talos:upgrade-k8s node=? to=?
# NOTE: This only needs to be run once against a controller node
task talos:upgrade-k8s controller=? to=?
# e.g.
# task talos:upgrade-k8s node=192.168.42.10 to=1.30.1
# task talos:upgrade-k8s controller=192.168.42.10 to=1.30.1
```

## 👉 Help
Expand Down

0 comments on commit d566efb

Please sign in to comment.