Troubleshoot the SubnetIsFull error code

This article discusses how to identify and resolve the SubnetIsFull error that occurs when you try to scale a Microsoft Azure Kubernetes Service (AKS) cluster.

Prerequisites

  • Azure CLI (version 2.0.59 or a later version)

Symptoms

When you try to scale an AKS cluster, you receive the following error message:

"code": "SubnetIsFull"

"message": "Subnet <subnet-name> with address prefix <subnet-prefix> does not have enough capacity for <new-ip-count> IP addresses."

Cause

To add nodes to an AKS cluster (scaling out), you have to use more IP addresses from the subnet in which the node pool is deployed. The exact number of new IP addresses that are required to successfully complete a cluster scale operation varies according to the networking plug-in that the cluster uses. For information about how IP addresses are allocated under each of these networking models, see Network concepts for applications in AKS.

Note

Azure reserves five IP addresses per subnet. The first address in the subnet is for the network ID, followed by three addresses that are used internally by Azure. The last address in the subnet is reserved for broadcast packets. For more information, see Are there any restrictions on using IP addresses within these subnets?

Solution

Trying to update a subnet's Classless Inter-Domain Routing (CIDR) address space in an existing node pool isn't currently supported. To migrate your workloads to a new node pool in a larger subnet, follow these steps:

  1. Create a subnet in the cluster virtual network that contains a larger CIDR address range than the existing subnet. For information about how to adequately size the subnet for your cluster, see Plan IP addressing for your cluster.

  2. Create a node pool on the new subnet by running the az aks nodepool add command together with the --vnet-subnet-id parameter.

  3. Migrate your workloads to the new node pool by draining the nodes in the old node pool. For information about how to safely drain AKS worker nodes, see Safely Drain a Node.

  4. Delete the original node pool by running the az aks nodepool delete command.

More information

Third-party contact disclaimer

Microsoft provides third-party contact information to help you find additional information about this topic. This contact information may change without notice. Microsoft does not guarantee the accuracy of third-party contact information.

Contact us for help

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.