Published 22 October 2026 · Updated 3 November 2026 · By Sonia (opens in a new tab), Developer relations, Zoorik

Short answer. Use the Horizontal Pod Autoscaler (HPA) when load rises and falls and more pods help. Use the Vertical Pod Autoscaler (VPA) when each pod’s requests sit far from its real use. You can run both, but not on the same CPU or memory metric: the HPA reads load against the request the VPA keeps changing.
When to use each
Take two Deployments. In the first, each pod uses 200m of the 500m of CPU it requests, all day. More pods would each reserve another 500m. This is the VPA’s job: it sets the request near real use, such as 250m.
In the second, traffic pushes 4 pods to 140% of their CPU request against a 70% target. The requests are fine, but 4 pods are too few. This is the HPA’s job: it scales to 8.
- Use the HPA when load rises and falls. The workload must be able to add replicas. For a CPU or memory utilization target, every container needs a request for that resource, or the HPA takes no action on that metric.
- Use the VPA when requests sit far from real use. It suits a steady service that more pods wouldn’t help.
- Use both on different signals. For example, a CPU-based HPA with a memory-only VPA.
- Keep the VPA off DaemonSet pods where a node autoscaler runs. Kubernetes warns it can make the autoscaler’s capacity predictions unreliable.
Key differences
| Question | VPA | HPA |
|---|---|---|
What it changes | Each container’s CPU and memory requests, and by default its limits in the same ratio | The number of replicas |
Part of Kubernetes | No. An add-on with its own custom resource, autoscaling.k8s.io/v1 | Yes. Built into the core API, autoscaling/v2 |
On AKS and EKS | Preconfigured in AKS Automatic. In AKS Standard you set it up yourself. On EKS, install Metrics Server, then run the autoscaler project’s vpa-up.sh script | Built in |
What it reads | Current and past CPU and memory use, and out-of-memory events | Usage as a share of the request, every 15 seconds, or custom and external metrics |
How a change lands | Evicts and recreates pods, or resizes them in place on Kubernetes 1.33 or later | Adds or removes pods. Scale-down waits 300 seconds by default |
What it needs | A metrics source such as Metrics Server | A metrics source, and a request on every container for a utilization target |
What it can’t do | Add pods, or remove nodes | Resize a pod, or scale a DaemonSet |
Fits best | Requests far from real use | Load that rises and falls |
How they work
The VPA
The VPA is an add-on from the Kubernetes autoscaler project, not part of the core API. You point its VerticalPodAutoscaler custom resource at a workload, such as a Deployment. It then sets that workload’s CPU and memory requests from measured use. By default it scales limits too, keeping the pod spec’s ratio of limit to request.
Three components do the work:
- Recommender. It reads current and past use, including out-of-memory (OOM) events, and stores a target request in the VPA’s status.
- Updater. It evicts or resizes running pods whose requests are far from that target, within their PodDisruptionBudgets.
- Admission controller. This mutating webhook writes the target into new pods.
Microsoft’s AKS documentation adds two limits. The recommender keeps at most 8 days of history. JVM-based workloads aren’t supported, because the VPA has limited visibility into their real memory use.
The VPA update modes, set in the updateMode field, decide what happens to running pods:
Offonly recommends: you read the target withkubectl describe vpa/<name>and apply it yourself.Initialsets requests only when a pod is created.Recreateevicts running pods whose requests differ significantly from the target, so they come back at the new size.Autois deprecated, and for now behaves exactly likeRecreate.InPlaceOrRecreateapplies an in-place pod resize to running pods, and evicts them only when it can’t.InPlacenever evicts: when a resize can’t happen, it waits and retries.
The HPA
The HPA is built into Kubernetes: the HorizontalPodAutoscaler object in autoscaling/v2, run by a control loop in the kube-controller-manager. Every 15 seconds by default, it reads a metric. Then it changes the replica count of a Deployment, StatefulSet or other scalable workload to hold that metric at a target.
For a CPU or memory utilization target, the metric is usage as a percentage of the request. The HPA reads it from the resource metrics API, metrics.k8s.io, which Metrics Server usually serves. Its core rule is:
desiredReplicas = ceil(currentReplicas × currentMetric ÷ targetMetric)
For the second Deployment above, that’s ceil(4 × 140 ÷ 70) = 8 pods. By default, the HPA skips any change while the ratio of current to target stays within 0.1 of 1.0. It scales down only after a 300-second stabilization window.
Custom and external metrics work too. On a CPU or memory utilization target, every decision divides by the pod’s request.
Requests decide node count
The scheduler places pods by their CPU and memory requests, not their use. A pod fits a node only if its requests, plus those already there, fit the node’s capacity. So a request set “to be safe” at four times real use keeps you paying for nodes that do almost nothing.
Node autoscalers such as the Cluster Autoscaler and Karpenter count the same way. They add nodes to fit requests and consolidate on requests, not real use. A request set too high can stop a node from being removed.
Limits are a separate control: the kernel throttles a container at its CPU limit and may OOM-kill one that goes past its memory limit.
HPA and VPA together
The HPA and VPA work together only on different signals. On the same CPU or memory metric, they feed each other. Each request change from the VPA looks like a load change to the HPA, so the pod count follows the VPA, not real load.
The same loop happens on memory. The VPA project says not to pair the VPA with an HPA on the same resource metric, CPU or memory. Microsoft’s AKS documentation doesn’t recommend that pair either.
How to run both
The VPA project allows the first two patterns, which use different signals. The third keeps the VPA out of running pods:
- Let the VPA size memory only, with
controlledResources: ["memory"], and let the HPA scale on CPU. - Scale the HPA on a custom or external metric, such as requests per second or queue length, while the VPA sizes CPU and memory.
- Keep the VPA in
Offmode, read its targets, and set requests yourself when you deploy.
The first pattern, on Kubernetes 1.33 or later:
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: <app>-vpa
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: <app>
updatePolicy:
updateMode: "InPlaceOrRecreate"
resourcePolicy:
containerPolicies:
- containerName: "<container>"
controlledResources: ["memory"]
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: <app>
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: <app>
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70On an older cluster or VPA release, use Recreate in place of InPlaceOrRecreate. In the first and third patterns, the CPU request under the HPA is still yours to set.
Set requests first
The HPA is only as accurate as the request it divides by, so work in this order:
- Size requests to measured use. Take a high percentile of CPU over several days plus headroom, and the peak of memory. Leave limits alone until you know why they were set.
- Then set the HPA target. With requests near real use, a 70% target means 70% of what a pod really needs.
- Then let the node autoscaler remove spare nodes. Smaller requests fit on fewer nodes, and the Cluster Autoscaler or Karpenter can remove the empty ones.
Where you pay for nodes, smaller requests alone don’t reduce cost. Cost falls when a node is removed.
Where Coral fits
Coral is Kubernetes cost optimization for AKS and EKS. It does the VPA’s job without the VPA, and it works with your HPA.
- Requests. Coral rebalances CPU and memory requests to real use, with its own recommender and webhook. Your manifests stay as they are, and new pods start at the new size. Running pods are resized in place on Kubernetes 1.33 or later, or else restarted one at a time within their PodDisruptionBudgets.
- Your VPAs. With automation on, Coral switches an active VPA to Off. It restores the VPA when you switch automation off or disconnect.
- Your HPA. The HPA decides how many pods run, and Coral decides how big each pod is. For a CPU-based HPA, Coral replays past load through that HPA’s own settings before it picks a request. A smaller request wins only if its saving beats the cost of unserved load and extra scaling. While the HPA is scaling and below its max, Coral holds back its CPU raises and pauses pod replacements until every pod is Ready.
- HPAs it manages. With automation on, Coral creates an HPA for an eligible Deployment or Argo Rollout that has none, with
minReplicasof 2 or more. Every built-in policy except read-only does this. On an HPA nothing else manages, Coral can take over: it keeps yourminReplicasand only raisesmaxReplicas. Workload optimization never changes HPAs from Helm, KEDA or kubectl apply, or HPAs whose bounds Argo CD or Flux own. - Nodes. Coral drains and removes the nodes you don’t need, one at a time. Node optimization is on from install, and you can limit it to chosen node pools.
- Opt-in. Pod sizing waits for you: Coral only recommends until you switch on automation for a policy or a workload.
On our own AKS development cluster, Coral removed a spare worker and rebalanced the requests of 14 apps. Then it swapped the remaining worker for a cheaper machine of the same size. Eight days after we connected it, the cluster’s machines cost $154.76 a month instead of $368.65, 58% less.
Sources: Kubernetes, “Horizontal Pod Autoscaling” (opens in a new tab); Kubernetes, “Vertical Pod Autoscaling” (opens in a new tab); Kubernetes, “Resource Management for Pods and Containers” (opens in a new tab); Kubernetes, “Node Autoscaling” (opens in a new tab); Kubernetes autoscaler project, Vertical Pod Autoscaler “Known limitations” (opens in a new tab); Kubernetes autoscaler project, Vertical Pod Autoscaler “Features” (opens in a new tab); Microsoft Learn, “Vertical Pod Autoscaling in Azure Kubernetes Service (AKS)” (opens in a new tab); Amazon EKS, “Adjust pod resources with Vertical Pod Autoscaler” (opens in a new tab).