Skip to content

Commit 6181b49

Browse files
committed
serverless-fleets - create also zonal subnetpools
1 parent a8ebfa6 commit 6181b49

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

serverless-fleets/init-fleet-sandbox

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,7 @@ if ! ibmcloud ce pds get --name fleet-input-store >/dev/null 2>&1; then
635635
fi
636636

637637

638-
print_msg "\nCreating the Code Engine subnetpool 'fleet-subnetpool' ..."
639-
create_or_update=update
640-
638+
print_msg "\nCreating the Code Engine subnetpools 'fleet-subnetpool' ..."
641639
if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool >/dev/null 2>&1; then
642640
security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')"
643641
ibmcloud ce connectivity subnetpool create --name fleet-subnetpool \
@@ -648,6 +646,15 @@ if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool >/dev/null
648646
--subnet-crn key_3="$(ibmcloud is subnet ${vpc_name}-subnet-3 --output json | jq -r '.crn')" \
649647
--security-group-crn key_3="${security_group_crn}"
650648
fi
649+
for i in {1..3}
650+
do
651+
if ! ibmcloud ce connectivity subnetpool get --name fleet-subnetpool-zone-$i >/dev/null 2>&1; then
652+
security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')"
653+
ibmcloud ce connectivity subnetpool create --name fleet-subnetpool-zone-$i \
654+
--subnet-crn key="$(ibmcloud is subnet ${vpc_name}-subnet-$i --output json | jq -r '.crn')" \
655+
--security-group-crn key="${security_group_crn}"
656+
fi
657+
done
651658

652659
print_msg "\nCreating the Code Engine default secret 'codeengine-fleet-defaults' with observability and VPC subnet configurations ..."
653660
create_or_update=update

0 commit comments

Comments
 (0)