Skip to content

Commit

Permalink
Merge pull request #1032 from equinor/egress-ips
Browse files Browse the repository at this point in the history
check if there is enough Egress ips available before creating cluster
  • Loading branch information
sondresjolyst authored Aug 29, 2023
2 parents abf1759 + 987e73b commit 97ba2c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions scripts/aks/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ if [ "$MIGRATION_STRATEGY" = "aa" ]; then
echo "Getting list of available public egress ips in $RADIX_ZONE..."
AVAILABLE_EGRESS_IPS="$(az network public-ip list \
--query "[?publicIPPrefix.id=='${IPPRE_EGRESS_ID}' && ipConfiguration.resourceGroup==null].{name:name, id:id, ipAddress:ipAddress}")"
AVAILABLE_EGRESS_IPS_COUNT="$(jq length <<<"${AVAILABLE_EGRESS_IPS}")"

# Select range of egress ips based on OUTBOUND_IP_COUNT
SELECTED_EGRESS_IPS="$(echo "$AVAILABLE_EGRESS_IPS" | jq '.[0:'$OUTBOUND_IP_COUNT']')"
Expand All @@ -339,6 +340,10 @@ if [ "$MIGRATION_STRATEGY" = "aa" ]; then
elif [[ -z $AVAILABLE_EGRESS_IPS ]]; then
echo "ERROR: Found no available ips to assign to the destination cluster. Exiting..." >&2
exit 1
elif [[ "${AVAILABLE_EGRESS_IPS_COUNT}" -lt "${OUTBOUND_IP_COUNT}" ]]; then
echo "ERROR: Too few Egress IPs available."
echo "Tip: You might need to do a teardown of an early clusters first."
exit 1
else
echo ""
echo "-----------------------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion scripts/aks/production.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NODE_VM_SIZE_DESCRIPTION="16 vCPU, 128GB RAM"
#NODE_VM_SIZE="Standard_E8as_v4"
#NODE_VM_SIZE_DESCRIPTION="8 vCPU, 64GB RAM"
POD_PER_NODE="110" # how many pods each node can run. Max in AKS and k8s is 110
OUTBOUND_IP_COUNT="3" # how many public ips will be assigned to the cluster.
OUTBOUND_IP_COUNT="4" # how many public ips will be assigned to the cluster.


#######################################################################################
Expand Down

0 comments on commit 97ba2c2

Please sign in to comment.