diff --git a/.envrc b/.envrc index a6fb72a177..5a86bcc687 100644 --- a/.envrc +++ b/.envrc @@ -2,3 +2,4 @@ export KUBECONFIG="$(PWD)/kubernetes/kubeconfig" export SOPS_AGE_KEY_FILE="$(PWD)/age.key" export TALOSCONFIG="$(PWD)/talos/clusterconfig/talosconfig" +export TASK_X_MAP_VARIABLES=0 diff --git a/.taskfiles/Bootstrap/Taskfile.yaml b/.taskfiles/Bootstrap/Taskfile.yaml new file mode 100644 index 0000000000..9018987ba4 --- /dev/null +++ b/.taskfiles/Bootstrap/Taskfile.yaml @@ -0,0 +1,14 @@ +--- +version: "3" + +tasks: + + k8s: + desc: Bootstrap K8s from start to finish + cmds: + - task: :talos:bootstrap + - task: :rook:reset + - task: :flux:bootstrap + preconditions: + - test -f {{.KUBERNETES_DIR}}/talosconfig + - talosctl config info >/dev/null 2>&1 diff --git a/.taskfiles/Talos/Taskfile.yaml b/.taskfiles/Talos/Taskfile.yaml index 2c6a557497..582613421f 100644 --- a/.taskfiles/Talos/Taskfile.yaml +++ b/.taskfiles/Talos/Taskfile.yaml @@ -10,8 +10,8 @@ x-vars: &vars sh: talosctl config info --output json | jq --raw-output '.endpoints[]' | shuf -n 1 vars: - TALHELPER_SECRET_FILE: "{{.TALOS_DIR}}/talsecret.sops.yaml" - TALHELPER_CONFIG_FILE: "{{.TALOS_DIR}}/talconfig.yaml" + TALHELPER_SECRET_FILE: '{{.TALOS_DIR}}/talsecret.sops.yaml' + TALHELPER_CONFIG_FILE: '{{.TALOS_DIR}}/talconfig.yaml' tasks: @@ -107,7 +107,7 @@ tasks: generate-secret: desc: Generate Talos secret prompt: This will overwrite the existing secret ... continue? - dir: "{{.TALOS_DIR}}" + dir: '{{.TALOS_DIR}}' cmds: - talhelper gensecret > {{.TALHELPER_SECRET_FILE}} - sops --encrypt --in-place {{.TALHELPER_SECRET_FILE}} @@ -116,14 +116,14 @@ tasks: generate-config: desc: Generate Talos config - dir: "{{.TALOS_DIR}}" + dir: '{{.TALOS_DIR}}' cmd: talhelper genconfig preconditions: - test -f {{.TALHELPER_CONFIG_FILE}} apply-config: desc: Apply Talos config to the nodes - dir: "{{.TALOS_DIR}}" + dir: '{{.TALOS_DIR}}' cmd: talhelper gencommand apply | bash preconditions: - test -f {{.TALHELPER_CONFIG_FILE}} diff --git a/Taskfile.yaml b/Taskfile.yaml index 74f7b0a842..0baaa767e1 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -1,9 +1,6 @@ --- version: "3" -# TODO: Clean up `--context` usage -# Ref: https://github.com/go-task/task/issues/1038 - vars: KUBERNETES_DIR: "{{.ROOT_DIR}}/kubernetes" TALOS_DIR: "{{.ROOT_DIR}}/talos" @@ -13,6 +10,7 @@ env: SOPS_AGE_KEY_FILE: "{{.ROOT_DIR}}/age.key" includes: + bootstrap: .taskfiles/Bootstrap external-secrets: .taskfiles/ExternalSecrets flux: .taskfiles/Flux kubernetes: .taskfiles/Kubernetes