[Yandex Cloud documentation](../../../index.md) > [Yandex Managed Service for Kubernetes](../../index.md) > [Concepts](../index.md) > Node group > Node group autoscaling

# Node group autoscaling in Managed Service for Kubernetes

The cluster autoscaler resizes the [node group](../index.md#node-group) based on resource requests for the [pods](../index.md#pod) running on the nodes of that group.

## How the autoscaler works {#how-scale}

When [creating a node group](../../operations/node-group/node-group-create.md#node-group-create), you specify the minimum and maximum number of nodes in the group, and the [Kubernetes cluster](../index.md#kubernetes-cluster) will check the status of pods and nodes from time to time:
* If pods cannot be assigned due to a lack of resources (vCPU, RAM) on the existing nodes, the number of nodes in the group will gradually increase to the specified maximum number.
* If the load on the nodes is insufficient, and all pods can be assigned with fewer nodes per group, the number of nodes per group will gradually decrease to the specified minimum number.

## Autoscaling features {#scaling-features}

You can resize an autoscaling group using [Kubernetes cluster-autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler), but there are many non-trivial features. In particular:
* If you can distribute the load in a cluster to a smaller number of nodes, but you cannot evict pods from the nodes for some reason, the number of nodes in a group will not decrease.
* The actual number of nodes in a group may be below the minimum size of a node group. This may occur if:
  * Autoscaling group was scaled up from its minimum size after being created.
  * Actual cluster load does not require more nodes than the cluster currently has.
* You can place an autoscaling node group only in one [availability zone](../../../overview/concepts/geo-scope.md).

{% note tip %}

If unexpected behavior occurs, we recommend referring to the [Kubernetes cluster-autoscaler FAQ](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md).

{% endnote %}

{% note info %}

When calculating the current limits and [quotas](https://console.yandex.cloud/cloud?section=quotas), Managed Service for Kubernetes uses the specified maximum node group size as its actual size, regardless of the current group size.

{% endnote %}

The node group autoscaler is different from [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale). The Horizontal Pod Autoscaler uses a controller to periodically request resource usage based on the metrics defined in each Kubernetes API [HorizontalPodAutoscaler](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#horizontalpodautoscaler-v2-autoscaling) object. You can use both mechanisms in parallel.

## Use cases {#examples}

* [DNS autoscaling based on the cluster size](../../tutorials/dns-autoscaler.md)