File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,39 @@ jobs:
100100 echo "🆕 AKS cluster doesn't exist, will be created by Terraform"
101101 fi
102102
103+ # ###############################################################
104+ # 2.5 · Reconcile AKS cluster if it exists
105+ # ###############################################################
106+ - name : Reconcile AKS cluster
107+ run : |
108+ set -euo pipefail
109+ RG="rg-aks-memgraph-${{ env.ENVIRONMENT }}"
110+ AKS="aks-memgraph-${{ env.ENVIRONMENT }}"
111+
112+ if az aks show --resource-group "$RG" --name "$AKS" &>/dev/null; then
113+ echo "🔄 Reconciling AKS cluster to fix node resource group..."
114+ az aks update --resource-group "$RG" --name "$AKS" --no-wait
115+
116+ echo "⏳ Waiting for reconciliation to complete..."
117+ max_retries=10
118+ retry_count=0
119+ while [ $retry_count -lt $max_retries ]; do
120+ if az aks show --resource-group "$RG" --name "$AKS" --query "provisioningState" -o tsv | grep -q "Succeeded"; then
121+ echo "✅ AKS reconciliation completed successfully"
122+ break
123+ fi
124+ echo "⏳ AKS still reconciling, waiting 30s... ($(($retry_count + 1))/$max_retries)"
125+ sleep 30
126+ retry_count=$((retry_count + 1))
127+ done
128+
129+ if [ $retry_count -eq $max_retries ]; then
130+ echo "⚠️ AKS reconciliation timed out but continuing with deployment"
131+ fi
132+ else
133+ echo "⏭️ No existing AKS cluster to reconcile"
134+ fi
135+
103136 # ###############################################################
104137 # 3 · Terraform apply
105138 # ###############################################################
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ resource "azurerm_kubernetes_cluster" "this" {
5151 name = " default"
5252 node_count = 1
5353 vm_size = var. node_vm_size
54+
55+ # Explicitly define upgrade settings to match Azure defaults
56+ upgrade_settings {
57+ max_surge = " 33%"
58+ }
5459 }
5560
5661 identity { type = " SystemAssigned" }
You can’t perform that action at this time.
0 commit comments