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 <[email protected]>
  • Loading branch information
onedr0p committed May 31, 2024
1 parent 77c112b commit 67ed0a4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
21 changes: 16 additions & 5 deletions .taskfiles/Talos/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -54,23 +55,33 @@ 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
cmd: talosctl --nodes {{.node}} upgrade-k8s --to {{.to}}
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
Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ You have two different options for setting up your local workstation.
```sh
kubectl get nodes -o wide
# NAME STATUS ROLES AGE VERSION
# k8s-0 Ready control-plane,etcd,master 1h v1.29.1
# k8s-1 Ready worker 1h v1.29.1
# k8s-0 Ready control-plane,etcd,master 1h v1.30.1
# k8s-1 Ready worker 1h v1.30.1
```
3. Continue on to 🔹 [**Stage 6**](#-stage-6-install-flux-in-your-cluster)
Expand Down Expand Up @@ -352,6 +352,24 @@ Below is a general guide on trying to debug an issue with an resource or applica
Resolving problems that you have could take some tweaking of your YAML manifests in order to get things working, other times it could be a external factor like permissions on NFS. If you are unable to figure out your problem see the help section below.
## ⬆️ Upgrading Talos and Kubernetes
### Manual
```sh
# Upgrade Talos to a newer version
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=?
# e.g.
# task talos:upgrade-k8s node=192.168.42.10 to=1.30.1
```
## 👉 Help
- Make a post in this repository's Github [Discussions](https://github.com/onedr0p/cluster-template/discussions).
Expand All @@ -361,11 +379,11 @@ Resolving problems that you have could take some tweaking of your YAML manifests

The cluster is your oyster (or something like that). Below are some optional considerations you might want to review.

#### Ship it
### Ship it

To browse or get ideas on applications people are running, community member [@whazor](https://github.com/whazor) created [Kubesearch](https://kubesearch.dev) as a creative way to search Flux HelmReleases across Github and Gitlab.

#### Storage
### Storage

The included CSI (openebs in local-hostpath mode) is a great start for storage but soon you might find you need more features like replicated block storage, or to connect to a NFS/SMB/iSCSI server. If you need any of those features be sure to check out the projects like [rook-ceph](https://github.com/rook/rook), [longhorn](https://github.com/longhorn/longhorn), [openebs](https://github.com/openebs/openebs), [democratic-csi](https://github.com/democratic-csi/democratic-csi), [csi-driver-nfs](https://github.com/kubernetes-csi/csi-driver-nfs),
and [synology-csi](https://github.com/SynologyOpenSource/synology-csi).
Expand Down

1 comment on commit 67ed0a4

@volschin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for extending the talos upgrade information. 🫶

Please sign in to comment.