auto select control plane node and --preserve for my single node cluster
This commit is contained in:
parent
15fc6f4249
commit
acb7bf085b
1 changed files with 9 additions and 2 deletions
|
@ -48,8 +48,15 @@ tasks:
|
||||||
|
|
||||||
fetch-kubeconfig:
|
fetch-kubeconfig:
|
||||||
desc: Fetch kubeconfig from Talos controllers
|
desc: Fetch kubeconfig from Talos controllers
|
||||||
|
vars:
|
||||||
|
CONTROLPLANE_NODE:
|
||||||
|
sh: |
|
||||||
|
talosctl --context {{.cluster}} config info \
|
||||||
|
| grep Endpoints: \
|
||||||
|
| awk '{split($0,u," "); print u[2]}' \
|
||||||
|
| sed -E 's/,//'
|
||||||
cmd: |
|
cmd: |
|
||||||
talosctl --context {{.cluster}} kubeconfig --nodes {{.controller}} \
|
talosctl --context {{.cluster}} kubeconfig --nodes {{.CONTROLPLANE_NODE}} \
|
||||||
--force --force-context-name {{.cluster}} {{.ROOT_DIR}}/kubeconfig
|
--force --force-context-name {{.cluster}} {{.ROOT_DIR}}/kubeconfig
|
||||||
requires:
|
requires:
|
||||||
vars:
|
vars:
|
||||||
|
@ -86,7 +93,7 @@ tasks:
|
||||||
--env-file {{.KUBERNETES_DIR}}/bootstrap/talos/talenv.sops.yaml \
|
--env-file {{.KUBERNETES_DIR}}/bootstrap/talos/talenv.sops.yaml \
|
||||||
--config-file {{.KUBERNETES_DIR}}/bootstrap/talos/talconfig.yaml
|
--config-file {{.KUBERNETES_DIR}}/bootstrap/talos/talconfig.yaml
|
||||||
cmds:
|
cmds:
|
||||||
- talosctl --context {{.cluster}} upgrade -n {{.node}} --image {{.TALOS_IMAGE }}
|
- talosctl --context {{.cluster}} upgrade -n {{.node}} --image {{.TALOS_IMAGE }} --preserve # single node talos cluster needs to be preserved
|
||||||
requires:
|
requires:
|
||||||
vars:
|
vars:
|
||||||
- cluster
|
- cluster
|
||||||
|
|
Loading…
Reference in a new issue