Skip to content

Commit 7c3a051

Browse files
author
sivakami
committed
Create clusters parallely
1 parent 43c34a7 commit 7c3a051

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.pipelines/swiftv2-long-running/scripts/create_aks.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,33 @@ az account set --subscription "$SUBSCRIPTION_ID"
1717
echo "==> Creating resource group: $RG"
1818
az group create -n "$RG" -l "$LOCATION" --output none
1919

20-
# AKS clusters
21-
for CLUSTER in "aks-cluster-a" "aks-cluster-b"; do
20+
# Enable parallel cluster creation
21+
create_cluster() {
22+
local CLUSTER=$1
2223
echo "==> Creating AKS cluster: $CLUSTER"
24+
2325
az aks create -g "$RG" -n "$CLUSTER" -l "$LOCATION" \
2426
--network-plugin azure --node-count 1 \
2527
--node-vm-size "$VM_SKU_DEFAULT" \
2628
--enable-managed-identity --generate-ssh-keys \
27-
--load-balancer-sku standard --yes
29+
--load-balancer-sku standard --yes --only-show-errors
2830

2931
echo "==> Adding high-NIC nodepool to $CLUSTER"
3032
az aks nodepool add -g "$RG" -n highnic \
3133
--cluster-name "$CLUSTER" --node-count 2 \
32-
--node-vm-size "$VM_SKU_HIGHNIC" --mode User
33-
done
34+
--node-vm-size "$VM_SKU_HIGHNIC" --mode User --only-show-errors
35+
36+
echo "Finished AKS cluster: $CLUSTER"
37+
}
38+
39+
# Run both clusters in parallel
40+
create_cluster "aks-cluster-a" &
41+
pid_a=$!
42+
43+
create_cluster "aks-cluster-b" &
44+
pid_b=$!
45+
46+
# Wait for both to finish
47+
wait $pid_a $pid_b
48+
49+
echo "AKS clusters created successfully!"

.pipelines/swiftv2-long-running/template/long-running-pipeline-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ stages:
8787
# ------------------------------------------------------------
8888
- job: Create_Storage
8989
displayName: "Create Storage"
90-
dependsOn: Create_Peerings
90+
dependsOn: Create_AKS
9191
pool:
9292
vmImage: ubuntu-latest
9393
steps:

0 commit comments

Comments
 (0)