diff --git a/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_INSTALL_SCRIPT.sh index 8192d98..6fb5cf6 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 +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" diff --git a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh index 88eab96..6a24537 100644 --- a/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/MASTER_PRE_INSTALL_SCRIPT.sh @@ -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 -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" diff --git a/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh b/installation-scripts-onm/WORKER_INSTALL_SCRIPT.sh index 2aa1e31..ff82f18 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 +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" diff --git a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh index b8bc11c..c0e9597 100644 --- a/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh +++ b/installation-scripts-onm/WORKER_PRE_INSTALL_SCRIPT.sh @@ -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 -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" diff --git a/k3s/install-kube-k3s-agent-u22-wg.sh b/k3s/install-kube-k3s-agent-u22-wg.sh index 266875e..542c447 100644 --- a/k3s/install-kube-k3s-agent-u22-wg.sh +++ b/k3s/install-kube-k3s-agent-u22-wg.sh @@ -12,7 +12,7 @@ sudo touch $LOGFILE sudo chown $USER:$USER $LOGFILE WIREGUARD_SERVER=192.168.55.1 -NODE_TOKEN=${APPLICATION_ID} +NODE_TOKEN=$1 K3S_VERSION=v1.26.15+k3s1 # All the output of this shell script is redirected to the LOGFILE diff --git a/k3s/install-kube-k3s-server-u22-wg.sh b/k3s/install-kube-k3s-server-u22-wg.sh index 9257277..bccd474 100644 --- a/k3s/install-kube-k3s-server-u22-wg.sh +++ b/k3s/install-kube-k3s-server-u22-wg.sh @@ -16,6 +16,7 @@ K3S_DEP_PATH=$HOME/k3s CILIUM_VERSION=1.15.5 POD_CIDR=10.244.0.0/16 K3S_VERSION=v1.26.15+k3s1 +TOKEN=$1 # All the output of this shell script is redirected to the LOGFILE exec 3>&1 4>&2 @@ -30,9 +31,9 @@ log_print(){ echo "$level [$(date)]: $Message" >&3 } -log_print INFO "Installing k3s server" +log_print INFO "Installing k3s server for APPLICATION_ID: ${TOKEN}" WIREGUARD_VPN_IP=`ip a | grep wg | grep inet | awk '{print $2}' | cut -d'/' -f1` -curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${K3S_VERSION} INSTALL_K3S_EXEC="--cluster-cidr ${POD_CIDR} --token ${APPLICATION_ID} --flannel-backend=none --disable-network-policy --bind-address ${WIREGUARD_VPN_IP} --node-ip ${WIREGUARD_VPN_IP} --write-kubeconfig-mode 644" sh - +curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${K3S_VERSION} INSTALL_K3S_EXEC="--cluster-cidr ${POD_CIDR} --token ${TOKEN} --flannel-backend=none --disable-network-policy --bind-address ${WIREGUARD_VPN_IP} --node-ip ${WIREGUARD_VPN_IP} --write-kubeconfig-mode 644" sh - export KUBECONFIG=/etc/rancher/k3s/k3s.yaml log_print INFO "Setting NODE_TOKEN environmental variable (default expiry 1d)"