AKS evicted pods and restarted node while it appears that the node has sufficient cpu and memory resources

Ming Yu 70 Reputation points
2025-12-17T17:04:43.66+00:00

We have an AKS running 1.32.9 with two nodes.

Each node is configured with max. 70 pods.

We noticed that, from time to time, some of our deployments were evicted and one of the nodes could have been restarted when the number of max pods on the node reached 70.

All of those affected deployments use horizontal pod auto scaler and can scale out additional pods depending on the load.

My understanding is that, when a node is maxed out in its pod's threshold, the AKS should scale out additional node instead of evicting pods and restarting the node.

Since we did not enable pod disruption budget on those deployments, the node restart could create a small time window during which the deployments' replica sets has 0 pods. This creates a small windowed outage.

We did an experiment by increasing the minimal number of nodes from 2 to 3, which appears to have resolved the issue.

But having 3 nodes in the cluster seems to have created a waste of resources since each node's cpu and memory is now significantly underutilized (see screenshot):

User's image

For optimal resource usage, we thin both CPU and memory usage should be approx. 80% for all nodes.

Note: even when the cluster had only two nodes, both CPU and memory usage did not exceed 80%.

We need help from experts on why the AKS did not scale out additional node when existing node's pod capacity is maxed out.

Thanks.

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jilakara Hemalatha 6,770 Reputation points Microsoft External Staff Moderator
    2025-12-17T18:16:43.1533333+00:00

    Hello Ming Yu

    Thank you for reaching out and for sharing the detailed scenario along with the results of your testing.

    The behavior you observed is expected in AKS and is not related to CPU or memory utilization, but rather to pod density limits on the node. In AKS, the maxPods value configured on a node pool is a hard scheduling limit. Once a node reaches this limit (70 pods in your case), Kubernetes cannot schedule additional pods on that node, even if sufficient CPU and memory are still available.

    AKS uses Cluster Autoscaler to add new nodes, but it only scales out when it detects unschedulable pods in a Pending state. In this scenario, pods were evicted shortly after the pod limit was reached and did not remain Pending long enough for Cluster Autoscaler to trigger a scale-out. As a result, a new node was not added automatically when the pod limit was exhausted.

    The brief service interruption occurred because Pod Disruption Budgets (PDBs) were not configured. Without a PDB, Kubernetes allows all replicas of a deployment to be evicted during a node restart, which can temporarily result in zero running pods.

    When you increased the minimum node count from two to three, the issue was resolved because additional scheduling headroom was available. However, CPU and memory appear underutilized because pod count, not compute capacity, was the limiting factor.

    Recommended Actions

    Increase the maxPods value on the node pool (for example, 110 or higher), provided your subnet has sufficient IP capacity or by using Azure CNI Overlay.

    Ensure Cluster Autoscaler is enabled and properly configured.

    Configure Pod Disruption Budgets for all critical workloads to prevent zero-replica outages.

    Monitor pod density per node in addition to CPU and memory usage.

    These changes will help prevent pod evictions, avoid service interruptions, and allow better utilization of available resources.

    Please find below documentations for reference:

    Configure Azure CNI networking in Azure Kubernetes Service (AKS)

    Use the cluster autoscaler in Azure Kubernetes Service (AKS)

    Manually scale the node count in an Azure Kubernetes Service (AKS) cluster

    Pod Disruption Budgets

    Below thread for similar issue:

    https://github.com/Azure/AKS/issues/2665

    https://github.com/Azure/azure-cli/issues/13420

    Hope this helps! Please let me know if you have any queries.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.