fix: update k0s kubeconfig with kube-vip addr

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2024-01-22 15:53:02 -05:00
1 parent afbf097dac
commit 9f82047a62
1 file changed
+6 -1
+6 -1
View File
@@ -31,7 +31,12 @@ tasks:
kubeconfig:
desc: Gets k0s kubeconfig
prompt: This will overwrite the existing kubeconfig... continue?
cmd: k0sctl kubeconfig --config {{.K0S_CONFIG_FILE}} > {{.KUBECONFIG_FILE}}
cmds:
- k0sctl kubeconfig --config {{.K0S_CONFIG_FILE}} > {{.KUBECONFIG_FILE}}
- sed -i {{if eq OS "darwin"}}''{{end}} 's|https://.+:6443|https://{{.kube_api_addr}}:6443|g' {{.KUBECONFIG_FILE}}
vars:
kube_api_addr:
sh: "yq '.bootstrap_kube_api_addr' {{.BOOTSTRAP_CONFIG_FILE}}"
preconditions:
- { msg: "Missing K0s config file", sh: "test -f {{.K0S_CONFIG_FILE}}" }