From 67ed0a4f19e24b5a25671239b6c959130d67aeb6 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Fri, 31 May 2024 08:23:32 -0400 Subject: [PATCH] fix: improve talos taskfile and add upgrade docs to README.md Signed-off-by: Devin Buhl --- .taskfiles/Talos/Taskfile.yaml | 21 ++++++++++++++++----- README.md | 26 ++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.taskfiles/Talos/Taskfile.yaml b/.taskfiles/Talos/Taskfile.yaml index 2fec0e97d55..cb533bfd735 100644 --- a/.taskfiles/Talos/Taskfile.yaml +++ b/.taskfiles/Talos/Taskfile.yaml @@ -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 diff --git a/README.md b/README.md index 252087d7947..926130b2d48 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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). @@ -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).