fix: no more relative paths in talos taskfile
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
1 file changed
+10
-14
@@ -3,28 +3,27 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
TALOS_DIR: "{{.KUBERNETES_DIR}}/bootstrap/talos"
|
TALHELPER_CLUSTER_DIR: "{{.KUBERNETES_DIR}}/bootstrap/talos/clusterconfig"
|
||||||
TALHELPER_SECRET_FILE: "{{.TALOS_DIR}}/talsecret.sops.yaml"
|
TALHELPER_SECRET_FILE: "{{.KUBERNETES_DIR}}/bootstrap/talos/talsecret.sops.yaml"
|
||||||
TALHELPER_CONFIG_FILE: "{{.TALOS_DIR}}/talconfig.yaml"
|
TALHELPER_CONFIG_FILE: "{{.KUBERNETES_DIR}}/bootstrap/talos/talconfig.yaml"
|
||||||
HELMFILE_FILE: "{{.KUBERNETES_DIR}}/bootstrap/helmfile.yaml"
|
HELMFILE_FILE: "{{.KUBERNETES_DIR}}/bootstrap/helmfile.yaml"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TALOSCONFIG: "{{.TALOS_DIR}}/clusterconfig/talosconfig"
|
TALOSCONFIG: "{{.TALHELPER_CLUSTER_DIR}}/talosconfig"
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
bootstrap:
|
bootstrap:
|
||||||
desc: Bootstrap the Talos cluster
|
desc: Bootstrap the Talos cluster
|
||||||
dir: "{{.TALOS_DIR}}"
|
|
||||||
cmds:
|
cmds:
|
||||||
- |
|
- |
|
||||||
if [ ! -f "{{.TALHELPER_SECRET_FILE}}" ]; then
|
if [ ! -f "{{.TALHELPER_SECRET_FILE}}" ]; then
|
||||||
talhelper gensecret > {{.TALHELPER_SECRET_FILE}}
|
talhelper gensecret > {{.TALHELPER_SECRET_FILE}}
|
||||||
sops --encrypt --in-place {{.TALHELPER_SECRET_FILE}}
|
sops --encrypt --in-place {{.TALHELPER_SECRET_FILE}}
|
||||||
fi
|
fi
|
||||||
- talhelper genconfig --secret-file {{.TALHELPER_SECRET_FILE}}
|
- talhelper genconfig --config-file {{.TALHELPER_CONFIG_FILE}} --secret-file {{.TALHELPER_SECRET_FILE}} --out-dir {{.TALHELPER_CLUSTER_DIR}}
|
||||||
- talhelper gencommand apply --extra-flags=--insecure | bash
|
- talhelper gencommand apply --config-file {{.TALHELPER_CONFIG_FILE}} --out-dir {{.TALHELPER_CLUSTER_DIR}} --extra-flags="--insecure" | bash
|
||||||
- until talhelper gencommand bootstrap | bash; do sleep 10; done
|
- until talhelper gencommand bootstrap --config-file {{.TALHELPER_CONFIG_FILE}} --out-dir {{.TALHELPER_CLUSTER_DIR}} | bash; do sleep 10; done
|
||||||
- task: fetch-kubeconfig
|
- task: fetch-kubeconfig
|
||||||
- task: install-helm-apps
|
- task: install-helm-apps
|
||||||
- talosctl health --server=false
|
- talosctl health --server=false
|
||||||
@@ -38,15 +37,13 @@ tasks:
|
|||||||
|
|
||||||
fetch-kubeconfig:
|
fetch-kubeconfig:
|
||||||
desc: Fetch kubeconfig
|
desc: Fetch kubeconfig
|
||||||
dir: "{{.TALOS_DIR}}"
|
cmd: until talhelper gencommand kubeconfig --config-file {{.TALHELPER_CONFIG_FILE}} --out-dir {{.TALHELPER_CLUSTER_DIR}} --extra-flags="{{.ROOT_DIR}} --force" | bash; do sleep 10; done
|
||||||
cmd: until talhelper gencommand kubeconfig --extra-flags "{{.ROOT_DIR}} --force" | bash; do sleep 10; done
|
|
||||||
preconditions:
|
preconditions:
|
||||||
- msg: Missing talhelper config file
|
- msg: Missing talhelper config file
|
||||||
sh: test -f {{.TALHELPER_CONFIG_FILE}}
|
sh: test -f {{.TALHELPER_CONFIG_FILE}}
|
||||||
|
|
||||||
install-helm-apps:
|
install-helm-apps:
|
||||||
desc: Bootstrap core apps needed for Talos
|
desc: Bootstrap core apps needed for Talos
|
||||||
dir: "{{.TALOS_DIR}}"
|
|
||||||
cmds:
|
cmds:
|
||||||
- until kubectl --kubeconfig {{.KUBECONFIG_FILE}} wait --for=condition=Ready=False nodes --all --timeout=600s; do sleep 10; done
|
- until kubectl --kubeconfig {{.KUBECONFIG_FILE}} wait --for=condition=Ready=False nodes --all --timeout=600s; do sleep 10; done
|
||||||
- helmfile --kubeconfig {{.KUBECONFIG_FILE}} --file {{.HELMFILE_FILE}} apply --skip-diff-on-install --suppress-diff
|
- helmfile --kubeconfig {{.KUBECONFIG_FILE}} --file {{.HELMFILE_FILE}} apply --skip-diff-on-install --suppress-diff
|
||||||
@@ -78,9 +75,8 @@ tasks:
|
|||||||
nuke:
|
nuke:
|
||||||
desc: Resets nodes back to maintenance mode
|
desc: Resets nodes back to maintenance mode
|
||||||
prompt: This will destroy your cluster and reset the nodes back to maintenance mode... continue?
|
prompt: This will destroy your cluster and reset the nodes back to maintenance mode... continue?
|
||||||
dir: "{{.TALOS_DIR}}"
|
cmd: talhelper gencommand reset --config-file {{.TALHELPER_CONFIG_FILE}} --out-dir {{.TALHELPER_CLUSTER_DIR}} --extra-flags="--reboot {{- if eq .CLI_FORCE false }} --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL{{ end }} --graceful=false --wait=false" | bash
|
||||||
cmd: talhelper gencommand reset --extra-flags "--reboot {{- if eq .CLI_FORCE false }} --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL{{ end }} --graceful=false --wait=false" | bash
|
|
||||||
|
|
||||||
.reset:
|
.reset:
|
||||||
internal: true
|
internal: true
|
||||||
cmd: rm -rf {{.TALOS_DIR}}
|
cmd: rm -rf {{.TALHELPER_CLUSTER_DIR}} {{.TALHELPER_SECRET_FILE}} {{.TALHELPER_CONFIG_FILE}}
|
||||||
Reference in new issue
Block a user