---
title: Kubernetes Cluster Autoscaling
description: Automatically scale your clusters with Kubernetes Cluster Autoscaling.
breadcrumbs: Docs > Containers > Kubernetes Autoscaling > Kubernetes Cluster Autoscaling
---

# Kubernetes Cluster Autoscaling

{% callout %}
##### Join the Preview!

Datadog Kubernetes Cluster Autoscaling is in Preview. Use this form to submit your request today.

[Request Access](https://www.datadoghq.com/product-preview/kubernetes-cluster-autoscaling/)
{% /callout %}

{% alert level="warning" %}
During the Preview period, Datadog recommends **non-production use only** of Datadog Kubernetes Autoscaling.
{% /alert %}

## Requirements{% #requirements %}

- Datadog Agent v7.75+

- Datadog Operator v1.23.0+ **or** Datadog Helm chart v3.155.1+

- [Remote Configuration](https://docs.datadoghq.com/agent/remote_config) must be enabled both at the organization level and on the Agents in your target cluster. See [Enabling Remote Configuration](https://docs.datadoghq.com/agent/remote_config/?tab=configurationyamlfile#enabling-remote-configuration) for setup instructions.

- Datadog user permissions:

  - Org Management
  - API Keys Write
  - Autoscaling Manage

By default, all Datadog admin users have Autoscaling Manage, and all Datadog users have read access to view recommendations and reporting.

To grant Autoscaling Manage to an additional standard or custom role user, see [Datadog Role Permissions](https://docs.datadoghq.com/account_management/rbac/permissions/#overview) for instructions.

## Setup{% #setup %}

1. Activate Cluster Autoscaling.

   {% tab title="Datadog Operator" %}
Set `features.autoscaling.cluster.enabled` to `true` in your `DatadogAgent` spec.

   ```yaml
   spec:
     features:
       autoscaling:
         cluster:
           enabled: true
   ```

      {% /tab %}

   {% tab title="Helm" %}
Set `datadog.autoscaling.cluster.enabled` to `true` in your `datadog-values.yaml` file.

   ```yaml
   datadog:
     autoscaling:
       cluster:
         enabled: true
   ```

Then run `helm upgrade`.
   {% /tab %}

1. If you do not have an existing installation of Karpenter, install the [Datadog `kubectl` plugin](https://docs.datadoghq.com/containers/kubernetes/kubectl_plugin/). This plugin assists in installing or connecting to your existing Karpenter configuration.

   ```shell
   kubectl krew install datadog
   ```

1. Run the `kubectl` plugin and pass in AWS credentials for the AWS project that the cluster is running:

   ```shell
   AWS_PROFILE=<foo> AWS_REGION=<bar> kubectl datadog autoscaling cluster install
   ```

This command creates:

   - Two CloudFormation stacks named `dd-karpenter-$CLUSTER_NAME`
   - A Helm release named `karpenter` in the Kubernetes namespace `dd-karpenter`
   - Karpenter's `EC2NodeClass` and `NodePool` objects

For more detailed command options, run [`kubectl datadog autoscaling cluster install --help`](https://docs.datadoghq.com/containers/kubernetes/kubectl_plugin/).

## Autoscale a cluster{% #autoscale-a-cluster %}

In Datadog, navigate to [Kubernetes Autoscaling](https://app.datadoghq.com/orchestration/scaling/summary). You can review all your clusters that are available for autoscaling on the [Autoscaling Settings](https://app.datadoghq.com/orchestration/scaling/settings) page. Toggle the **Enabled** column for your cluster of choice.

{% image
   source="https://docs.dd-static.net/images/containers/autoscaling/settings.e906807e5ca238620207ca9168a9a534.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/containers/autoscaling/settings.e906807e5ca238620207ca9168a9a534.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt=" The Autoscaling Settings page showing the Enable Clusters for Autoscaling section. Displays a filterable table of Kubernetes clusters with columns for cluster name, nodes, CPU capacity, memory capacity, CPU usage percentage with visual bars, memory usage percentage with visual bars, autoscaled workloads count, cluster scaling availability, workload scaling availability, and an enabled toggle switch. Toggle switches on the right show which clusters have autoscaling enabled." /%}

Use the [Cluster Scaling](https://app.datadoghq.com/orchestration/scaling/cluster) page and select a cluster to review its recommendations. Identify a cluster you want to begin optimizing. During the Preview period, Datadog recommends selecting a **non-production cluster**.

{% image
   source="https://docs.dd-static.net/images/containers/autoscaling/cluster-view.2352f39f67e3355553e684bf60cf3de4.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/containers/autoscaling/cluster-view.2352f39f67e3355553e684bf60cf3de4.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The Cluster Scaling detail page for cluster dev-eks-shopist-a-us-east-1. The Cost Summary section displays four metrics: cluster cost of $140.7k with negative $3.1k month-over-month change, idle cost of $93.66k with negative $2.29k change, CPU usage/request efficiency at 27.24%, and memory usage/request efficiency at 35.15%. The Scaling Events section shows two time-series graphs tracking CPU and memory metrics over the past month, with fluctuating usage patterns, alongside a timeline of recent scaling events including pod and DatadogPodAutoscaler activities. The Scaling Recommendations section displays a table of workloads with idle CPU and memory, showing 8.7% autoscaling enabled." /%}

Click **Start Autoscaling** to apply recommendations.
