Troubleshoot the AKSCapacityError error code

This article discusses how to identify and resolve the AKSCapacityError error that might occur when you create or start a Microsoft Azure Kubernetes Service (AKS) cluster.

Symptoms

When you try to create or start an AKS cluster, you receive one of the following error messages:

Code: AKSCapacityError

Message 1: Creating or starting a free tier cluster is unavailable at this time in region <Region>. To create a new cluster, we recommend using an alternate region, or create a paid tier cluster. For a list of all the Azure regions, visit https://aka.ms/aks/regions. For more details on this error, visit https://aka.ms/akscapacityerror.

Message 2: Creating a new cluster or starting cluster is unavailable at this time in region <Region>. To create a new cluster, we recommend using an alternate region. For a list of all the Azure regions, visit https://aka.ms/aks/regions. For more details on this error, visit https://aka.ms/akscapacityerror.

If you then try to do an operation on that cluster after it doesn't start, you receive the following error message:

"statusCode": "InternalServerError",

"serviceRequestId": null,

"statusMessage": "{"code": "KubernetesAPICallFailed", "message": "API call to Kubernetes API Server failed."}.

Cause

You're trying to deploy a cluster in a region that has limited capacity.

When you create or start an AKS cluster, Microsoft Azure allocates compute resources to your subscription. You might occasionally experience the AKSCapacityError error because of significant growth in demand for Azure Kubernetes Service in specific regions.

The KubernetesAPICallFailed error message indicates that the AKS cluster didn't start and doesn't have an associated control plane. Therefore, calls to the API server are failing. In this case, you have to retry the Start operation.

Resolution

Solution 1: Select a different region

The easiest and quickest solution is to try to deploy to a different region (for example, NorthEurope instead of WestEurope or UAENorth instead of QatarCentral). To find nearby regions, visit the Azure Geographies page.

This approach might not be feasible if you already have existing resources in the requested region, but it's the preferred solution in a dev/test scenario.

Solution 2: Try deploying a cluster that has different settings

The infrastructure that hosts AKS managed clusters have different allocation reservations. Therefore, AKS might have more capacity for public clusters than for private clusters. If you encounter the AKSCapacityError error when you try to create a private cluster, try to create a public cluster instead or vice versa.

Solution 3: Use an Azure Enterprise subscription

When capacity is running low, we limit free tier AKS clusters for customers who don't have an Enterprise Agreement (EA) subscription first in order to reserve resources for real production scenarios. Make sure that you use an EA subscription to create your AKS cluster.

Solution 4: Retry the operation

Capacity is often reclaimed when other users stop or delete their AKS clusters. Therefore, the operation might succeed if you retry it later.

More information

  • Ensuring capacity for users is a top priority for Microsoft, and we're working around the clock to reach this goal. The increasing popularity of Azure services emphasizes the need for us to scale up our infrastructure even more rapidly. With that in mind, we're expediting expansions and improving our resource deployment process to respond to strong customer demand. We're also adding a large amount of compute infrastructure monthly.

    We have identified several methods to improve how we load-balance under a high-resource-usage situation, and how to trigger the timely deployment of needed resources. Additionally, we're significantly increasing our capacity, and will continue to plan for strong demand across all regions. This September 2021 Azure Blog article discusses improvements that we're making toward delivering a resilient cloud supply chain.

  • General troubleshooting of AKS cluster creation issues

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.