diff options
Diffstat (limited to 'playbooks.d/k3s-master/playbook.bash')
-rw-r--r-- | playbooks.d/k3s-master/playbook.bash | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/playbooks.d/k3s-master/playbook.bash b/playbooks.d/k3s-master/playbook.bash index cfd0330..f19fe8c 100644 --- a/playbooks.d/k3s-master/playbook.bash +++ b/playbooks.d/k3s-master/playbook.bash @@ -10,6 +10,7 @@ playbook_add() { node-name: "${BASHTARD_PLATFORM[fqdn]}" node-ip: "$(config "$BASHTARD_PLAYBOOK.internal-ip" "127.0.0.1")" bind-address: "$(config "$BASHTARD_PLAYBOOK.bind-address" "0.0.0.0")" + flannel-backend: wireguard-native cluster-cidr: "$(config "$BASHTARD_PLAYBOOK.cluster-cidr" "172.19.0.0/16")" cluster-domain: "$(config "$BASHTARD_PLAYBOOK.cluster-domain" "cluster.local")" service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")" @@ -17,17 +18,22 @@ playbook_add() { - traefik EOF + if [[ -n "$(config "$BASHTARD_PLAYBOOK.flannel-iface" "")" ]] + then + printf "flannel-iface: \"%s\"\n" "$(config "$BASHTARD_PLAYBOOK.flannel-iface")" + fi + if [[ -n "$(config "$BASHTARD_PLAYBOOK.external-ip" "")" ]] then - printf "%s: \"%s\"\n" "node-external-ip" "$(config "$BASHTARD_PLAYBOOK.external-ip" "")" + printf "node-external-ip: \"%s\"\n" "$(config "$BASHTARD_PLAYBOOK.external-ip")" fi } > "$(config "fs.etcdir")/rancher/k3s/config.yaml" info "$BASHTARD_PLAYBOOK/add" "Installing k3s" curl -sfL https://get.k3s.io | sh -s - server --cluster-init # I hate this - #notice "$BASHTARD_PLAYBOOK/add" "Creating data directories" - #mkdir -pv -- "$(playbook_path "data")/manifests.d" + notice "$BASHTARD_PLAYBOOK/add" "Creating data directories" + mkdir -pv -- "$(playbook_path "data")/manifests.d" notice "$BASHTARD_PLAYBOOK/add" "Waiting for node to become available" { grep -q -m 1 "${BASHTARD_PLATFORM[fqdn]}[[:space:]]\+Ready"; kill $!; } < <(k3s kubectl get node -w) |