Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/Add vertical rightsizing to hpa scaled kubernetes workloads
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

Add vertical rightsizing to HPA-scaled Kubernetes workloads

Source: Datadog•December 1, 2026 at 04:09 PM

Add vertical rightsizing to HPA-scaled Kubernetes workloads

Rightsize Kubernetes workloads with HPA-compatible vertical scaling, recommended configurations, and stepped scale-down with health checks.

Application teams often set CPU and memory requests high to protect workloads from throttling and out-of-memory (OOM) kills. The gap between requested and used resources is large: According to Datadog’s State of Containers and Serverless, most workloads use less than 25% of their requested CPU and less than half of their requested memory. Vertical rightsizing can close that gap but adds risk for workloads whose Horizontal Pod Autoscaler (HPA) scales on CPU or memory utilization.

Datadog Kubernetes Autoscaling already coordinates horizontal and vertical scaling in its multidimensional scaling mode. Now, workloads can gain vertical rightsizing without migrating off their HPA, so they scale in both dimensions. Kubernetes Autoscaling also automatically recommends a scaling configuration that fits each workload, and it can progressively reduce CPU and memory requests and check workload health along the way.

In this post, we’ll explain how you can:

  • Add vertical rightsizing alongside an existing HPA

Add vertical rightsizing alongside an existing HPA

  • Start each workload with a recommended configuration

Start each workload with a recommended configuration

  • Reduce resource requests gradually with stepped scale-down

Reduce resource requests gradually with stepped scale-down

Add vertical rightsizing alongside an existing HPA

The upstream Vertical Pod Autoscaler (VPA) project advises against running VPA with an HPA on the same resource metric, whether CPU or memory. Because four out of five HPA deployments scale on CPU or memory utilization, that advice rules out vertical rightsizing for most workloads with an HPA, so their requests stay overprovisioned.

Vertical scaling can trigger horizontal scaling that usage doesn’t call for. An HPA that scales on CPU calculates utilization by dividing a pod’s CPU usage by its CPU request, which gives the percentage of the request the pod is using. The VPA and the HPA don’t know about each other, so when the VPA lowers that request, the HPA sees utilization rise even though usage hasn’t changed. If utilization crosses the HPA’s target, the HPA adds replicas, which puts back some of the requested CPU that rightsizing removed. The extra replicas also lower usage per pod, which can prompt the VPA to reduce requests again.

Suppose a pod uses 0.5 CPU against a request of 1 CPU, and its HPA targets 70% CPU utilization. The pod’s utilization is 50%. If vertical scaling reduces its request to 0.6 CPU while usage stays constant, utilization rises to approximately 83%. The HPA can interpret that increase as a reason to scale out, even though usage hasn’t changed.

Rightsize requests while your HPA scales replicas

Kubernetes Autoscaling’s new HPA compatibility addresses the conflict between vertical rightsizing and CPU- or memory-based HPAs. The Datadog Pod Autoscaler, which applies Kubernetes Autoscaling’s recommendations to your workloads, can now rightsize requests on a workload with a CPU- or memory-based HPA while avoiding unneeded scale-outs. To do this, the Datadog Pod Autoscaler reads your HPA’s configuration, such as a 60% CPU utilization target, and treats the HPA as the controller for horizontal scaling.

The Datadog Pod Autoscaler applies the same algorithm it uses in multidimensional scaling mode but produces only vertical changes, so it can rightsize requests without disrupting horizontal scaling. Your HPA keeps managing replicas exactly as configured. If a workload has no HPA, multidimensional scaling mode lets the Datadog Pod Autoscaler handle both horizontal and vertical scaling itself.

The following screenshot shows the recommended configuration for a workload with a detected HPA, with vertical-only scaling selected.

Set up autoscaling alongside your HPA

When you set up autoscaling for a workload that already has an HPA, Kubernetes Autoscaling preselects the HPA-compatible configuration in the setup form. If you manage autoscaling through GitOps, you can enable the same behavior with an annotation on the DatadogPodAutoscaler resource. Either way, the annotation is what turns on HPA compatibility. The setup form adds it to the DatadogPodAutoscaler resource it generates for you.

Start each workload with a recommended configuration

The HPA-compatible configuration is one of several that Kubernetes Autoscaling can preselect, so you start from a recommended configuration instead of building one for every workload. When you use the setup form, Kubernetes Autoscaling looks at three characteristics of each workload:

  • Replica count: A workload that has run three or fewer replicas for at least a week and has no HPA, such as a leader-elected controller, gains little from adding replicas. In this case, Kubernetes Autoscaling preselects vertical scaling. A workload that runs many replicas and scales with traffic, such as a stateless API, is a better fit for multidimensional scaling.

Replica count: A workload that has run three or fewer replicas for at least a week and has no HPA, such as a leader-elected controller, gains little from adding replicas. In this case, Kubernetes Autoscaling preselects vertical scaling. A workload that runs many replicas and scales with traffic, such as a stateless API, is a better fit for multidimensional scaling.

  • Existing HPA: A workload that already has an HPA gets the HPA-compatible configuration described in the previous section.

Existing HPA: A workload that already has an HPA gets the HPA-compatible configuration described in the previous section.

  • CPU spikiness: For a workload whose CPU usage spikes at startup, Kubernetes Autoscaling preselects burstable mode, which removes the CPU limit while continuing to rightsize the CPU request.

CPU spikiness: For a workload whose CPU usage spikes at startup, Kubernetes Autoscaling preselects burstable mode, which removes the CPU limit while continuing to rightsize the CPU request.

The following screenshot shows the recommended configuration for a single-pod workload with no HPA, with vertical-only scaling selected. You can review the preselected configuration before you apply it.

Datadog Cluster Agent v7.86.0 and later include a built-in datadog-vertical-balanced vertical scaling profile. You can select it as the Vertical balanced template in the setup form or apply it through GitOps workflows or annotations. It joins the existing cost, balance, and performance profiles and gives you a starting point for adopting vertical rightsizing across workloads.

Reduce resource requests gradually with stepped scale-down

Your most overprovisioned workloads offer the biggest rightsizing savings, but they’re also the riskiest to cut. Consider a service that requests 4 CPU but averages 1. Cutting its request straight to a recommended 1.5 CPU leaves little headroom if a traffic spike or batch job needs more resources than the recommendation anticipates. Large reductions in resource allocations can introduce performance risks, particularly when CPU or memory limits are adjusted alongside requests. CPU limits can cause throttling, while insufficient memory limits can lead to OOM kills.

Stepped scale-down lowers a workload’s CPU and memory requests through a series of small reductions instead of a single large one. The VPA applies its recommendation directly, without a configurable step size. Stepped scale-down evaluates the workload between steps. Before each further reduction, Kubernetes Autoscaling checks for OOM kills and watches the workload’s memory usage. You can set a vertical objective for each workload, such as 60% CPU and 50% memory utilization, the same way you set a target for an HPA. If memory usage rises above that objective after a step, Kubernetes Autoscaling pauses further reductions.

These checks turn stepped scale-down into a guardrail on automated rightsizing. Your most overprovisioned workloads can reach their recommended size with less risk of OOM kills and without manual supervision.

Get started with Kubernetes Autoscaling’s new capabilities

HPA compatibility, recommended configurations, and stepped scale-down make it easier to rightsize workloads without disrupting the scaling they already rely on. Rightsizing more of your workloads means paying for less CPU and memory that sits idle.

To learn more, read our guidance on deploying Kubernetes Autoscaling at scale and how Datadog reduced costs with Kubernetes Autoscaling.

If you don’t already have an account, you can sign up for a free 14-day trial.

← All articles

What this article says

More in Data & Analytics

All →
Catch stale AWS Glue data before it impacts your business
Datadog

Catch stale AWS Glue data before it impacts your business

Fix infrastructure issues automatically with Bits Autonomous Operations
Datadog

Fix infrastructure issues automatically with Bits Autonomous Operations

Bringing application context to full-host eBPF profiling
Datadog

Bringing application context to full-host eBPF profiling

Detect and diagnose OTel telemetry loss in Fleet Automation
Datadog

Detect and diagnose OTel telemetry loss in Fleet Automation

Move to OpenTelemetry at your own pace with Datadog OpenTelemetry (DDOT)
Datadog

Move to OpenTelemetry at your own pace with Datadog OpenTelemetry (DDOT)

Purview Data Governance Retirement: Plan Your Move
Alation

Purview Data Governance Retirement: Plan Your Move

More from Datadog

Catch stale AWS Glue data before it impacts your business
Datadog

Catch stale AWS Glue data before it impacts your business

Fix infrastructure issues automatically with Bits Autonomous Operations
Datadog

Fix infrastructure issues automatically with Bits Autonomous Operations

Bringing application context to full-host eBPF profiling
Datadog

Bringing application context to full-host eBPF profiling

Detect and diagnose OTel telemetry loss in Fleet Automation
Datadog

Detect and diagnose OTel telemetry loss in Fleet Automation

Move to OpenTelemetry at your own pace with Datadog OpenTelemetry (DDOT)
Datadog

Move to OpenTelemetry at your own pace with Datadog OpenTelemetry (DDOT)

Open sourcing PG Proxy: How we proxy 4 trillion queries a month
Datadog

Open sourcing PG Proxy: How we proxy 4 trillion queries a month