Delete an Azure Kubernetes Service (AKS) node pool
This article outlines node pool deletion in Azure Kubernetes Service (AKS), including what happens when you delete a node pool and how to delete a node pool.
What happens when you delete a node pool?
When you delete a node pool, the following resources are deleted:
- The virtual machine scale set (VMSS) and virtual machines (VMs) for each node in the node pool
- Any node instances in the node pool along with any pods running on those nodes
Delete a node pool
Important
Keep the following information in mind when deleting a node pool:
- You can't recover a node pool after it's deleted. You need to create a new node pool and redeploy your applications.
Delete a node pool using the az aks nodepool delete
command.
az aks nodepool delete \
--resource-group <resource-group-name> \
--cluster-name <cluster-name> \
--name <node-pool-name>
To verify that the node pool was deleted successfully, use the kubectl get nodes
command to confirm that the nodes in the node pool no longer exist.
Ignore PodDisruptionBudgets (PDBs) when removing an existing node pool
If your cluster has PodDisruptionBudgets that are preventing the deletion of the node pool, you can ignore the PodDisruptionBudget requirements by setting --ignore-pod-disruption-budget
to true
. To learn more about PodDisruptionBudgets, see:
- Plan for availability using a pod disruption budget
- Specifying a Disruption Budget for your Application
- Disruptions
Delete an existing node pool without following any PodDisruptionBudgets set on the cluster using the
az aks nodepool delete
command with the--ignore-pod-disruption-budget
flag set totrue
:az aks nodepool delete \ --resource-group myResourceGroup \ --cluster-name myAKSCluster \ --name nodepool1 --ignore-pod-disruption-budget true
To verify that the node pool was deleted successfully, use the
kubectl get nodes
command to confirm that the nodes in the node pool no longer exist.
Next steps
For more information about adjusting node pool sizes in AKS, see Resize node pools.
Azure Kubernetes Service