-
Notifications
You must be signed in to change notification settings - Fork 2
/
delete-gpu-node-pool.sh
31 lines (27 loc) · 1015 Bytes
/
delete-gpu-node-pool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
nodePoolName="gpu"
aksClusterName="YOUR-AKS-CLUSTER-NAME"
resourceGroupName="YOUR-AKS-RESOURCE-GROUP-NAME"
vmSize="Standard_NC6"
nodeCount=1
aksCustomHeaders="UseGPUDedicatedVHD=true"
taints="sku=gpu:NoSchedule"
labels="cputype=gpu"
az aks nodepool show \
--name $nodePoolName \
--cluster-name $aksClusterName \
--resource-group $resourceGroupName &>/dev/null
if [[ $? == 0 ]]; then
echo "A node pool called [$nodePoolName] already exists in the [$aksClusterName] AKS cluster"
az aks nodepool delete \
--name $nodePoolName \
--cluster-name $aksClusterName \
--resource-group $resourceGroupName 1>/dev/null
if [[ $? == 0 ]]; then
echo "[$nodePoolName] node pool successfully deleted in the [$aksClusterName] AKS cluster"
else
echo "Failed to delete the [$nodePoolName] node pool in the [$aksClusterName] AKS cluster"
fi
else
echo "No node pool called [$nodePoolName] actually exists in the [$aksClusterName] AKS cluster"
fi