|
@@ -351,7 +351,7 @@ done
|
|
|
|
|
|
setup_mesh() {( set -e
|
|
setup_mesh() {( set -e
|
|
|
|
|
|
-wait_seconds 5
|
|
|
|
|
|
+wait_seconds 15
|
|
|
|
|
|
echo "Creating netmaker network (10.101.0.0/16)"
|
|
echo "Creating netmaker network (10.101.0.0/16)"
|
|
|
|
|
|
@@ -371,23 +371,29 @@ echo "Configuring netmaker server as ingress gateway"
|
|
for i in 1 2 3 4 5 6
|
|
for i in 1 2 3 4 5 6
|
|
do
|
|
do
|
|
echo " waiting for server node to become available"
|
|
echo " waiting for server node to become available"
|
|
- wait_seconds 5
|
|
|
|
|
|
+ wait_seconds 10
|
|
curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker)
|
|
curlresponse=$(curl -s -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker)
|
|
SERVER_ID=$(jq -r '.[0].id' <<< ${curlresponse})
|
|
SERVER_ID=$(jq -r '.[0].id' <<< ${curlresponse})
|
|
- if [[ "$i" == 6 && -z "$SERVER_ID" ]]; then
|
|
|
|
|
|
+ echo " Server ID: $SERVER_ID"
|
|
|
|
+ if [ $SERVER_ID == "null" ]; then
|
|
|
|
+ SERVER_ID=""
|
|
|
|
+ fi
|
|
|
|
+ if [[ "$i" -ge "6" && -z "$SERVER_ID" ]]; then
|
|
echo " Netmaker is having issues configuring itself, please investigate (docker logs netmaker)"
|
|
echo " Netmaker is having issues configuring itself, please investigate (docker logs netmaker)"
|
|
echo " Exiting..."
|
|
echo " Exiting..."
|
|
exit 1
|
|
exit 1
|
|
elif [ -z "$SERVER_ID" ]; then
|
|
elif [ -z "$SERVER_ID" ]; then
|
|
echo " server node not yet configured, retrying..."
|
|
echo " server node not yet configured, retrying..."
|
|
- else
|
|
|
|
|
|
+ elif [[ ! -z "$SERVER_ID" ]]; then
|
|
echo " server node is now availble, continuing"
|
|
echo " server node is now availble, continuing"
|
|
break
|
|
break
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
|
|
|
|
-curl -o /dev/null -s -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker/$SERVER_ID/createingress
|
|
|
|
|
|
|
|
|
|
+if [[ ! -z "$SERVER_ID" ]]; then
|
|
|
|
+ curl -o /dev/null -s -X POST -H "Authorization: Bearer $MASTER_KEY" -H 'Content-Type: application/json' https://api.${NETMAKER_BASE_DOMAIN}/api/nodes/netmaker/$SERVER_ID/createingress
|
|
|
|
+fi
|
|
)}
|
|
)}
|
|
|
|
|
|
set +e
|
|
set +e
|