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

# Autoscaling

Autoscaling is when you resize a [node group](index.md#node-group), change the number of pods or the amount of resources allocated to each pod based on resource requests for [pods](index.md#pod) running on this group's nodes.

In a Managed Service for Kubernetes cluster, you can leverage the following auto-scaling options:
* _Cluster autoscaling_ (Cluster Autoscaler). Managed Service for Kubernetes monitors workloads on the nodes and updates the number of nodes within specified limits as required.
* _Master autoscaling_ (Master Autoscaler). Managed Service for Kubernetes monitors workload on the master node and updates its configuration as required.
* _Horizontal pod scaling_ (Horizontal Pod Autoscaler). Kubernetes dynamically changes the number of pods running on each node in the group.
* _Vertical pod scaling_ (Vertical Pod Autoscaler). When workloads increase, Kubernetes allocates additional resources to each pod within the set limits.

{% note warning %}

Starting June 18, 2026, master node auto-scaling will be enabled on all clusters in the `RAPID` [release channel](release-channels-and-updates.md) where the master is deployed in a [highly available configuration](index.md#master).

{% endnote %}

You can employ several types of autoscaling in the same cluster. However, using Horizontal Pod Autoscaler and Vertical Pod Autoscaler together is not recommended.

## Cluster autoscaling {#ca}

Cluster Autoscaler automatically modifies the number of nodes in a group depending on your workloads.

{% note warning %}

You can only place an autoscaling node group in one [availability zone](../../overview/concepts/geo-scope.md).

{% endnote %}

When [creating a node group](../operations/node-group/node-group-create.md), select an autoscaling type and set the minimum, maximum, and initial number of nodes in the group. Kubernetes will periodically check the pod status and workloads on the nodes, adjusting the group size as required:
* If pods cannot be assigned due to a lack of vCPUs or RAM on the existing nodes, the number of nodes in the group will gradually increase to the specified maximum.
* If a workload on nodes is low, and all pods can be assigned to fewer nodes in a group, the number of nodes in the group will gradually decrease to the specified minimum. If pods on the node cannot be evicted within the specified period of time (7 minutes), the node is forced to stop. The timeout cannot be changed.

{% 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 %}

Cluster Autoscaler activation is only available when creating a node group. Cluster Autoscaler is managed on the Managed Service for Kubernetes side.

For more information, see these Kubernetes guides:

* [Cluster Autoscaler description](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler)
* [Default parameters](https://github.com/kubernetes/autoscaler/blob/c6b754c359a8563050933a590f9a5dece823c836/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca)

See also [Questions and answers about node group autoscaling in Managed Service for Kubernetes](../qa/cluster-autoscaler.md).

## Master autoscaling {#master-autoscaler}

{% note warning %}

Starting June 18, 2026, master node auto-scaling will be enabled on all clusters in the `RAPID` [release channel](release-channels-and-updates.md) where the master is deployed in a [highly available configuration](index.md#master).

{% endnote %}

{% note warning %}

Starting June 18, 2026, master node pricing has changed, with fees now based on the number of vCPUs and the amount of RAM. Use [this table](master-configuration.md) to estimate the required master node resources for your cluster.

{% endnote %}

Master Autoscaler automatically adjusts master configuration according to the current workload. This enables stable cluster operation without manual configuration selection.

For scaling, Master Autoscaler regularly collects master utilization metrics, such as th number of vCPUs and the amount of RAM. It can then take the following decisions based on these metrics:

* Scale up resources if the master node is near overload.
* Scale down resources if the master node is consistently underutilized.
* Keep resources unchanged if utilization is within normal ranges.

To prevent reactions to brief load spikes, Master Autoscaler takes decisions based on aggregated metrics over a few minutes. Scaling is only triggered when a critical threshold persists for a sustained period.

Apart from that, Master Autoscaler does not scale down below the master configuration you selected when [creating](../operations/kubernetes-cluster/kubernetes-cluster-create.md) or [modifying](../operations/kubernetes-cluster/kubernetes-cluster-update.md#manage-resources) your cluster; such configuration acts as a lower scaling limit.

After taking a decision, the scaler selects the closest [matching master configuration](master-configuration.md) to ensure that post-scaling utilization remains within normal limits.

Even when using Master Autoscaler, choose the master configuration that matches the real cluster load. You may want to check out our [recommended configuration](master-configuration.md) options that depend on the number of nodes, maximum number of pods, and CNI in use. An over-provisioned vCPU and RAM configuration will prevent the release of excess resources, while an under-provisioned one may cause over-frequent scaling.

You can view the master node auto-scaling operations under [cluster operations](../operations/kubernetes-cluster/kubernetes-cluster-operation-logs.md). While scaling is in progress, you cannot initiate other cluster operations; you will have to wait for the process to complete.

## Horizontal pod autoscaling {#hpa}

When using horizontal pod scaling, Kubernetes changes the number of pods depending on vCPU workload.

When [creating a Horizontal Pod Autoscaler](../operations/autoscale.md#hpa), specify the following parameters:
* vCPU load average percentage for each pod.
* Minimum and maximum number of pod replicas.

Horizontal pod autoscaling is available for the following controllers:
* [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/).
* [StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/).
* [ReplicaSet](https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/).

Learn more about Horizontal Pod Autoscaler in [this Kubernetes guide](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/).

## Vertical pod autoscaling {#vpa}

Kubernetes uses the `limits` parameters to restrict resources allocated for each application. A pod exceeding the vCPU limit will trigger CPU throttling. A pod exceeding the RAM limit will be stopped.

If required, Vertical Pod Autoscaler allocates additional vCPU and RAM resources to pods.

When [creating a Vertical Pod Autoscaler](../operations/autoscale.md#vpa), set the autoscaling mode in the specification:
* `updateMode: "Off"` for Vertical Pod Autoscaler to [provide recommendations](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#quick-start) on managing pod resources without modifying them.
* `updateMode: "Initial"` for Vertical Pod Autoscaler to apply recommendations only when creating pods.
* `updateMode: "Recreate"` for Vertical Pod Autoscaler to recreate pods with updated resource values in case of a serious discrepancy between the current requests and recommendations.
* `updateMode: "InPlaceOrRecreate"` for Vertical Pod Autoscaler to attempt updating requests and resource limits first, without restarting the pod. If such an update is not possible, the pod will be recreated as in the `Recreate` mode. For more information, see [Resize CPU and Memory Resources assigned to Containers](https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/).

Learn more about Vertical Pod Autoscaler in [this Kubernetes guide](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler).

## Use cases {#examples}

* [Horizontal scaling of an application in a cluster](../tutorials/autoscaling.md)
* [Vertical scaling of an application in a cluster](../tutorials/vpa-autoscaling.md)