From 3a110576df764ebf296a0a44bb3870747718f193 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:27:52 +0100 Subject: [PATCH 01/11] Update MASTER_INSTALL_SCRIPT.sh Specify the output file of wget to prevent it creating multiple versions --- installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh index 6fb5cf6..0af507f 100644 --- a/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh @@ -4,4 +4,4 @@ echo "Master install script" K3S_DEP_PATH=$HOME/k3s echo "Installing K3s Server" -sudo -H -u ubuntu bash -c "wget -P ${K3S_DEP_PATH} https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-server-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh $APPLICATION_ID" +sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-server-u22-wg.sh -P ${K3S_DEP_PATH}/install-kube-k3s-server-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh $APPLICATION_ID" From 94e877b9778da7d146b58d8aeac8bd17ee982a34 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:28:33 +0100 Subject: [PATCH 02/11] Update MASTER_INSTALL_SCRIPT.sh --- installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh index 0af507f..0c1931e 100644 --- a/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh @@ -4,4 +4,4 @@ echo "Master install script" K3S_DEP_PATH=$HOME/k3s echo "Installing K3s Server" -sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-server-u22-wg.sh -P ${K3S_DEP_PATH}/install-kube-k3s-server-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh $APPLICATION_ID" +sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-server-u22-wg.sh -O ${K3S_DEP_PATH}/install-kube-k3s-server-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-server-u22-wg.sh $APPLICATION_ID" From 024c49d953ebc4470582b31a908551ed4e183694 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:31:40 +0100 Subject: [PATCH 03/11] Update MASTER_PRE_INSTALL_SCRIPT.sh Specify destination file for wget command to avoid versioning --- installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh index 6a24537..9ebc009 100644 --- a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh @@ -9,7 +9,7 @@ K3S_DEP_PATH=$HOME/k3s mkdir -p $K3S_DEP_PATH echo "Setting Wireguard Interface\n" -sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/main/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh && chmod +x onm-bootstrap.sh' +sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/main/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh -O onm-bootstrap.sh && chmod +x onm-bootstrap.sh' sudo -H -u ubuntu bash -c "./onm-bootstrap.sh 'CREATE' $APPLICATION_ID $ONM_URL $PUBLIC_IP $SSH_PORT"; echo "" echo "" @@ -19,4 +19,4 @@ WIREGUARD_VPN_IP=`ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1` echo "WIREGUARD_VPN_IP= $WIREGUARD_VPN_IP"; echo "Executing k3s-preinstall script\n" -sudo -H -u ubuntu bash -c "wget -P ${K3S_DEP_PATH} https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/preinstall-kube-k3s-u22.sh && chmod +x $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh && $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh" +sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/preinstall-kube-k3s-u22.sh -O ${K3S_DEP_PATH}/preinstall-kube-k3s-u22.sh && chmod +x $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh && $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh" From 72afdd0d5c2d785d1c77d800b40c6069fb1cb3c2 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:36:12 +0100 Subject: [PATCH 04/11] Update MASTER_PRE_INSTALL_SCRIPT.sh Get dev version of onm-bootstrap.sh --- installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh index 9ebc009..aea5354 100644 --- a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh @@ -9,7 +9,7 @@ K3S_DEP_PATH=$HOME/k3s mkdir -p $K3S_DEP_PATH echo "Setting Wireguard Interface\n" -sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/main/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh -O onm-bootstrap.sh && chmod +x onm-bootstrap.sh' +sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/dev/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh -O onm-bootstrap.sh && chmod +x onm-bootstrap.sh' sudo -H -u ubuntu bash -c "./onm-bootstrap.sh 'CREATE' $APPLICATION_ID $ONM_URL $PUBLIC_IP $SSH_PORT"; echo "" echo "" From 2ee4fa24bf38e3682f3008d61746c8583f1f468b Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:44:09 +0100 Subject: [PATCH 05/11] Update MASTER_PRE_INSTALL_SCRIPT.sh Wait for WIREGUARD_IP --- .../MASTER_PRE_INSTALL_SCRIPT.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh index aea5354..d5a2555 100644 --- a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh @@ -15,8 +15,16 @@ echo "" echo "" sleep 60 -WIREGUARD_VPN_IP=`ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1`; -echo "WIREGUARD_VPN_IP= $WIREGUARD_VPN_IP"; +while true; do + WIREGUARD_VPN_IP=$(ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1) + if [[ -n "$WIREGUARD_VPN_IP" ]]; then + log_print INFO "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" + break + fi + log_print INFO "Waiting for WIREGUARD_VPN_IP to be set..." + sleep 2 +done + echo "Executing k3s-preinstall script\n" sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/preinstall-kube-k3s-u22.sh -O ${K3S_DEP_PATH}/preinstall-kube-k3s-u22.sh && chmod +x $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh && $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh" From 8d2079ebce3c8d46538d7412ac58ae65c3d1dfb8 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 14:58:59 +0100 Subject: [PATCH 06/11] Update MASTER_START_SCRIPT.sh Assume yes for vela install command questions --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index f62e2b2..82359df 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -13,7 +13,7 @@ echo "Configuration complete." echo "Setting KubeVela..." $dau bash -c 'helm repo add kubevela https://kubevela.github.io/charts && helm repo update' -$dau bash -c 'vela install --version 1.9.11' +$dau bash -c 'vela install -y --version 1.9.11' $dau bash -c 'helm repo add nebulous https://eu-nebulous.github.io/helm-charts/' From 17ceba20242a640b5f16e88f94b334c4eeadd7b6 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 15:22:43 +0100 Subject: [PATCH 07/11] Update MASTER_START_SCRIPT.sh delete secret docker-registry before creating it --- installation-scripts-onm/MASTER_START_SCRIPT.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/installation-scripts-onm/MASTER_START_SCRIPT.sh b/installation-scripts-onm/MASTER_START_SCRIPT.sh index 82359df..3be134e 100644 --- a/installation-scripts-onm/MASTER_START_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_START_SCRIPT.sh @@ -22,6 +22,7 @@ $dau bash -c 'helm repo add netdata https://netdata.github.io/helmchart/' $dau bash -c 'helm repo update' echo "Login to docker registry" +$dau bash -c "kubectl delete secret docker-registry regcred --ignore-not-found" $dau bash -c "kubectl create secret docker-registry regcred --docker-server=$PRIVATE_DOCKER_REGISTRY_SERVER --docker-username=$PRIVATE_DOCKER_REGISTRY_USERNAME --docker-password=$PRIVATE_DOCKER_REGISTRY_PASSWORD --docker-email=$PRIVATE_DOCKER_REGISTRY_EMAIL" echo "Starting EMS" From 877af83ddbbdd450a4efee4af4eeda31b3cd9a0a Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 15:24:34 +0100 Subject: [PATCH 08/11] Update WORKER_INSTALL_SCRIPT.sh specify wget output file to avoid versioning --- installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh b/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh index ff82f18..29716df 100644 --- a/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh @@ -4,4 +4,4 @@ echo "Worker install script" echo "Installing K3s Agent" K3S_DEP_PATH=$HOME/k3s -sudo -H -u ubuntu bash -c "wget -P ${K3S_DEP_PATH} https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-agent-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-agent-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-agent-u22-wg.sh $APPLICATION_ID" +sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/install-kube-k3s-agent-u22-wg.sh -O ${K3S_DEP_PATH}/install-kube-k3s-agent-u22-wg.sh && chmod +x $K3S_DEP_PATH/install-kube-k3s-agent-u22-wg.sh && $K3S_DEP_PATH/install-kube-k3s-agent-u22-wg.sh $APPLICATION_ID" From a59e22cc0aa7965ab5e19eef82ff98b997bcadbf Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 15:27:07 +0100 Subject: [PATCH 09/11] Update WORKER_PRE_INSTALL_SCRIPT.sh Wait for WIREGUARD_VPN_IP Specify wget output file to avoid versioning --- .../WORKER_PRE_INSTALL_SCRIPT.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh index c0e9597..bfee8b6 100644 --- a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh @@ -9,14 +9,21 @@ K3S_DEP_PATH=$HOME/k3s mkdir -p $K3S_DEP_PATH echo "Setting Wireguard Interface\n" -sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/main/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh && chmod +x onm-bootstrap.sh' +sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/overlay-network-manager/main/network-manager/bootstrap-agent-scripts/onm/onm-bootstrap.sh -O onm-bootstrap.sh && chmod +x onm-bootstrap.sh' sudo -H -u ubuntu bash -c "./onm-bootstrap.sh 'CREATE' $APPLICATION_ID $ONM_URL $PUBLIC_IP $SSH_PORT"; echo "" echo "" -sleep 60 -WIREGUARD_VPN_IP=`ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1`; -echo "WIREGUARD_VPN_IP= $WIREGUARD_VPN_IP"; +while true; do + WIREGUARD_VPN_IP=$(ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1) + if [[ -n "$WIREGUARD_VPN_IP" ]]; then + echo INFO "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" + break + fi + echo INFO "Waiting for WIREGUARD_VPN_IP to be set..." + sleep 2 +done + echo "Executing k3s-preinstall script\n" -sudo -H -u ubuntu bash -c "wget -P ${K3S_DEP_PATH} https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/preinstall-kube-k3s-u22.sh && chmod +x $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh && $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh" +sudo -H -u ubuntu bash -c "wget https://raw.githubusercontent.com/eu-nebulous/sal-scripts/dev/k3s/preinstall-kube-k3s-u22.sh -O ${K3S_DEP_PATH}/preinstall-kube-k3s-u22.sh && chmod +x $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh && $K3S_DEP_PATH/preinstall-kube-k3s-u22.sh" From 0ec4d4a74e154f2676409f903cdf155d1781aa71 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 15:29:02 +0100 Subject: [PATCH 10/11] Update MASTER_PRE_INSTALL_SCRIPT.sh Wait WIREGUARD_VPN_IP to be set Remove 60 seconds delay --- installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh index d5a2555..47e870c 100644 --- a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh @@ -13,15 +13,15 @@ sudo -H -u ubuntu bash -c 'wget https://raw.githubusercontent.com/eu-nebulous/ov sudo -H -u ubuntu bash -c "./onm-bootstrap.sh 'CREATE' $APPLICATION_ID $ONM_URL $PUBLIC_IP $SSH_PORT"; echo "" echo "" -sleep 60 + while true; do WIREGUARD_VPN_IP=$(ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1) if [[ -n "$WIREGUARD_VPN_IP" ]]; then - log_print INFO "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" + echo "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" break fi - log_print INFO "Waiting for WIREGUARD_VPN_IP to be set..." + echo "Waiting for WIREGUARD_VPN_IP to be set..." sleep 2 done From 2c7b237c28157c3d70b863f06c71905dce7118a2 Mon Sep 17 00:00:00 2001 From: robert-sanfeliu Date: Mon, 2 Dec 2024 15:30:57 +0100 Subject: [PATCH 11/11] Update WORKER_PRE_INSTALL_SCRIPT.sh --- installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh index bfee8b6..8a3679e 100644 --- a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh @@ -17,10 +17,10 @@ echo "" while true; do WIREGUARD_VPN_IP=$(ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1) if [[ -n "$WIREGUARD_VPN_IP" ]]; then - echo INFO "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" + echo "WIREGUARD_VPN_IP is set to $WIREGUARD_VPN_IP" break fi - echo INFO "Waiting for WIREGUARD_VPN_IP to be set..." + echo "Waiting for WIREGUARD_VPN_IP to be set..." sleep 2 done