From 34e8dd8c1c39366699fcfb5525c602a0691546ec Mon Sep 17 00:00:00 2001 From: ag Date: Mon, 2 Oct 2023 10:42:26 +0200 Subject: [PATCH] commit by to_remotes 2023-10-02 10:42:26 +0200 from vmdevac --- init.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/init.sh b/init.sh index aba2c6d..cf69029 100755 --- a/init.sh +++ b/init.sh @@ -105,13 +105,37 @@ EOT fi + +if [ -z $WA_REPO/node_type.sh ]; then + echo " " + echo -n "init as master? type yes: " + read -r init_as_master + + if [ "$init_as_master" == "yes" ]; then + echo "NODE_TYPE=master" > $WA_REPO/node_type.sh + else + echo "NODE_TYPE=worker" > $WA_REPO/node_type.sh + fi +fi + +source $WA_REPO/node_type.sh + + echo " " echo -n "ready to set-up K8s? type yes: " read -r ready_to_setup_k8s if [ "$ready_to_setup_k8s" = "yes" ]; then - echo "<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=>" - echo "initializing K8s Set-Up" - source $WA_REPO/shared_resources_k8s/k8s/setup.sh + + + if [ "$NODE_TYPE" == "master" ]; then + echo "<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=>" + echo "initializing K8s Master Set-Up" + source $WA_REPO/shared_resources_k8s/k8s/setup_master.sh + else + echo "<=><=><=><=><=><=><=><=><=><=><=><=><=><=><=><=>" + echo "initializing K8s Worker Set-Up" + source $WA_REPO/shared_resources_k8s/k8s/setup_worker.sh + fi else echo "Aborting"