Files
home-cluster/.taskfiles/K0s/Taskfile.yaml
T
Devin Buhl 7c259abe44 fix: add talos docs to root readme (#1203)
* fix: add talos docs to root readme

Signed-off-by: Devin Buhl <devin@buhl.casa>
2024-01-19 10:45:21 -05:00

41 lines
1.1 KiB
YAML

---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
env:
DISABLE_TELEMETRY: "true"
DISABLE_UPGRADE_CHECK: "true"
vars:
K0S_CONFIG_FILE: "{{.KUBERNETES_DIR}}/k0s/k0sctl.yaml"
tasks:
apply:
desc: Apply k0s cluster config
dir: "{{.KUBERNETES_DIR}}/k0s" # Needed for uploading files in k0sctl.yaml
cmds:
- k0sctl apply --config {{.K0S_CONFIG_FILE}}
- task: kubeconfig
preconditions:
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }
nuke:
desc: Nuke the k0s cluster
deps: [":ansible:deps"]
cmds:
- k0sctl reset --config {{.K0S_CONFIG_FILE}}
preconditions:
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }
kubeconfig:
desc: Gets k0s kubeconfig
prompt: This will overwrite the existing kubeconfig... continue?
cmd: k0sctl kubeconfig --config {{.K0S_CONFIG_FILE}} > {{.KUBECONFIG_FILE}}
preconditions:
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }
.reset:
internal: true
cmd: rm -rf {{.K0S_CONFIG_FILE}}