ci: nodepool scale down for cilium pipeline (#3096)
* nodepool scale down instead of vmss scale * replace make target for scale-vmss with scale-nodes * set scale down to 5 * add nodepool name to scale target
This commit is contained in:
Родитель
97bcdb55d1
Коммит
2938c1feb6
|
@ -117,7 +117,7 @@ stages:
|
||||||
new_count=${NODE_COUNT_UP} # Do not exceed NODE_COUNT_UP
|
new_count=${NODE_COUNT_UP} # Do not exceed NODE_COUNT_UP
|
||||||
fi
|
fi
|
||||||
echo "Scaling up nodes to $new_count"
|
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} NODEPOOL=nodepool1 NODE_COUNT=$new_count
|
||||||
if [ $new_count -eq ${NODE_COUNT_UP} ]; then
|
if [ $new_count -eq ${NODE_COUNT_UP} ]; then
|
||||||
echo "Node count reached ${NODE_COUNT_UP}"
|
echo "Node count reached ${NODE_COUNT_UP}"
|
||||||
break
|
break
|
||||||
|
@ -442,6 +442,7 @@ stages:
|
||||||
- job: scale_down
|
- job: scale_down
|
||||||
pool:
|
pool:
|
||||||
name: "$(BUILD_POOL_NAME_DEFAULT)"
|
name: "$(BUILD_POOL_NAME_DEFAULT)"
|
||||||
|
timeoutInMinutes: 120
|
||||||
steps:
|
steps:
|
||||||
- task: AzureCLI@2
|
- task: AzureCLI@2
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -453,8 +454,7 @@ stages:
|
||||||
set -ex
|
set -ex
|
||||||
az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER}
|
az aks get-credentials --resource-group ${RESOURCE_GROUP} --name ${CLUSTER}
|
||||||
echo "Scaling to 5 nodes"
|
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-nodes AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} NODEPOOL=nodepool1 NODE_COUNT=5
|
||||||
make -C ./hack/aks scale-vmss AZCLI=az GROUP=${RESOURCE_GROUP} CLUSTER=${CLUSTER} REGION=$(LOCATION) VMSS_NAME=$vmss_name NODE_COUNT=5
|
|
||||||
kubectl get node
|
kubectl get node
|
||||||
name: "ScaleDown"
|
name: "ScaleDown"
|
||||||
displayName: "Scale down to 5 Nodes"
|
displayName: "Scale down to 5 Nodes"
|
||||||
|
|
|
@ -467,5 +467,5 @@ down: ## Delete the cluster
|
||||||
restart-vmss: ## Restarts the nodes in the cluster
|
restart-vmss: ## Restarts the nodes in the cluster
|
||||||
$(AZCLI) vmss restart -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME)
|
$(AZCLI) vmss restart -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME)
|
||||||
|
|
||||||
scale-vmss: ## Scales the nodes in the cluster
|
scale-nodes: ## Scales the nodes in the cluster
|
||||||
$(AZCLI) vmss scale -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME) --new-capacity $(NODE_COUNT)
|
$(AZCLI) aks nodepool scale --resource-group $(GROUP) --cluster-name $(CLUSTER) --name $(NODEPOOL) --node-count $(NODE_COUNT)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче