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"