From 4821635bd22aa6253e22541a5342a170c3566bae Mon Sep 17 00:00:00 2001 From: Camryn Lee Date: Wed, 30 Oct 2024 21:51:56 +0000 Subject: [PATCH 1/4] nodepool scale down instead of vmss scale --- .pipelines/cni/cilium/cilium-scale-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipelines/cni/cilium/cilium-scale-test.yaml b/.pipelines/cni/cilium/cilium-scale-test.yaml index c0d0d16cf3..7656cdbb60 100644 --- a/.pipelines/cni/cilium/cilium-scale-test.yaml +++ b/.pipelines/cni/cilium/cilium-scale-test.yaml @@ -442,6 +442,7 @@ stages: - job: scale_down pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + timeoutInMinutes: 120 steps: - task: AzureCLI@2 inputs: @@ -454,7 +455,7 @@ stages: az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER} echo "Scaling to 5 nodes" vmss_name=$(az vmss list -g MC_${RESOURCE_GROUP}_${CLUSTER}_$(LOCATION) --query "[].name" -o tsv) - make -C ./hack/aks scale-vmss AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} REGION=$(LOCATION) VMSS_NAME=$vmss_name NODE_COUNT=5 + az aks nodepool scale --name nodepool1 --cluster-name ${CLUSTER} --resource-group ${RESOURCE_GROUP} --node-count 5 kubectl get node name: "ScaleDown" displayName: "Scale down to 5 Nodes" From 8ae44c1cbd20746fd241898d140e5f31ef68805d Mon Sep 17 00:00:00 2001 From: Camryn Lee Date: Wed, 30 Oct 2024 22:01:39 +0000 Subject: [PATCH 2/4] replace make target for scale-vmss with scale-nodes --- .pipelines/cni/cilium/cilium-scale-test.yaml | 5 ++--- hack/aks/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pipelines/cni/cilium/cilium-scale-test.yaml b/.pipelines/cni/cilium/cilium-scale-test.yaml index 7656cdbb60..9bd5f6f48d 100644 --- a/.pipelines/cni/cilium/cilium-scale-test.yaml +++ b/.pipelines/cni/cilium/cilium-scale-test.yaml @@ -117,7 +117,7 @@ stages: new_count=${NODE_COUNT_UP} # Do not exceed NODE_COUNT_UP fi echo "Scaling up nodes to $new_count" - az aks nodepool scale --name nodepool1 --cluster-name ${CLUSTER} --resource-group ${RESOURCE_GROUP} --node-count $new_count + make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=$new_count if [ $new_count -eq ${NODE_COUNT_UP} ]; then echo "Node count reached ${NODE_COUNT_UP}" break @@ -454,8 +454,7 @@ stages: set -ex az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER} echo "Scaling to 5 nodes" - vmss_name=$(az vmss list -g MC_${RESOURCE_GROUP}_${CLUSTER}_$(LOCATION) --query "[].name" -o tsv) - az aks nodepool scale --name nodepool1 --cluster-name ${CLUSTER} --resource-group ${RESOURCE_GROUP} --node-count 5 + make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=$new_count kubectl get node name: "ScaleDown" displayName: "Scale down to 5 Nodes" diff --git a/hack/aks/Makefile b/hack/aks/Makefile index 6aedf52c01..170276a737 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -467,5 +467,5 @@ down: ## Delete the cluster restart-vmss: ## Restarts the nodes in the cluster $(AZCLI) vmss restart -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME) -scale-vmss: ## Scales the nodes in the cluster - $(AZCLI) vmss scale -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME) --new-capacity $(NODE_COUNT) +scale-nodes: ## Scales the nodes in the cluster + $(AZCLI) aks nodepool scale -g $(GROUP) -n $(CLUSTER) --node-count $(NODE_COUNT) From f81b77e87c20d5530b4b5610e1b21d444e7bcee9 Mon Sep 17 00:00:00 2001 From: Camryn Lee Date: Wed, 30 Oct 2024 22:02:30 +0000 Subject: [PATCH 3/4] set scale down to 5 --- .pipelines/cni/cilium/cilium-scale-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/cni/cilium/cilium-scale-test.yaml b/.pipelines/cni/cilium/cilium-scale-test.yaml index 9bd5f6f48d..d4d37fc7c6 100644 --- a/.pipelines/cni/cilium/cilium-scale-test.yaml +++ b/.pipelines/cni/cilium/cilium-scale-test.yaml @@ -454,7 +454,7 @@ stages: set -ex az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER} echo "Scaling to 5 nodes" - make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=$new_count + make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=5 kubectl get node name: "ScaleDown" displayName: "Scale down to 5 Nodes" From dfb32b8be07ab1b235df7a57542ccf926b9044a9 Mon Sep 17 00:00:00 2001 From: Camryn Lee Date: Wed, 30 Oct 2024 22:54:28 +0000 Subject: [PATCH 4/4] add nodepool name to scale target --- .pipelines/cni/cilium/cilium-scale-test.yaml | 4 ++-- hack/aks/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/cni/cilium/cilium-scale-test.yaml b/.pipelines/cni/cilium/cilium-scale-test.yaml index d4d37fc7c6..51f018b0bb 100644 --- a/.pipelines/cni/cilium/cilium-scale-test.yaml +++ b/.pipelines/cni/cilium/cilium-scale-test.yaml @@ -117,7 +117,7 @@ stages: new_count=${NODE_COUNT_UP} # Do not exceed NODE_COUNT_UP fi echo "Scaling up nodes to $new_count" - make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=$new_count + make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODEPOOL=nodepool1 NODE_COUNT=$new_count if [ $new_count -eq ${NODE_COUNT_UP} ]; then echo "Node count reached ${NODE_COUNT_UP}" break @@ -454,7 +454,7 @@ stages: set -ex az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER} echo "Scaling to 5 nodes" - make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODE_COUNT=5 + make -C ./hack/aks scale-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODEPOOL=nodepool1 NODE_COUNT=5 kubectl get node name: "ScaleDown" displayName: "Scale down to 5 Nodes" diff --git a/hack/aks/Makefile b/hack/aks/Makefile index 170276a737..e88c7e0019 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -468,4 +468,4 @@ restart-vmss: ## Restarts the nodes in the cluster $(AZCLI) vmss restart -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME) scale-nodes: ## Scales the nodes in the cluster - $(AZCLI) aks nodepool scale -g $(GROUP) -n $(CLUSTER) --node-count $(NODE_COUNT) + $(AZCLI) aks nodepool scale --resource-group $(GROUP) --cluster-name $(CLUSTER) --name $(NODEPOOL) --node-count $(NODE_COUNT)