Skip to main content
FinOps
Kubernetes
Autoscaling
Updated Dec 2026

Kubernetes Rightsizing: Setting Requests with VPA and In-Place Pod Resize

Your node bill follows the requests you declare, not the CPU and memory pods actually use. Here is a workflow to close that gap: measure, get recommendations from the Vertical Pod Autoscaler, and apply them without restarting pods.

Published December 3, 2026 · HostingX Solutions LLC

Short answer

  • Requests decide cost. The scheduler places pods by their requests, and cluster autoscalers add nodes for pods that don't fit, so inflated requests turn into idle nodes you pay for.

  • Measure first: compare a week or more of real CPU and memory usage with requests, then run the Vertical Pod Autoscaler (VPA) in Off mode to get recommendations without changing anything.

  • In-place pod resize is stable since Kubernetes 1.35. CPU and memory requests and limits can change on a running pod through the resize subresource; whether the container restarts is set per resource with resizePolicy.

  • VPA's InPlaceOrRecreate mode is GA in VPA 1.6.0: it resizes in place when it can and evicts only when it must. The old Auto mode is deprecated.

  • Don't run VPA and HPA on the same metric. Use VPA for memory and HPA for CPU, or HPA on custom metrics.

Why Requests Drive the Bill

Kubernetes uses a container's requests to decide where it can run, and the kubelet reserves at least the requested amount for it. Usage below the request is capacity that nobody else can be scheduled into. Because cluster autoscalers such as Karpenter and Cluster Autoscaler add nodes when pods can't be scheduled, requests set much higher than usage translate directly into more nodes. Rightsizing means bringing requests close to what workloads really use, with headroom, so the same nodes hold more pods.

SettingWhat Kubernetes does with itWhat goes wrong when it’s wrong
CPU requestThe scheduler uses it to pick a node, and the kubelet reserves at least that much for the containerToo high: you pay for nodes that sit idle. Too low: pods land on busy nodes and compete for CPU.
CPU limitEnforced by throttling: the kernel stops the container using more CPU than the limitToo low: latency spikes from throttling even when the node has spare CPU.
Memory requestUsed for scheduling; a container may use more if the node has it freeToo low: nodes get overcommitted and pods are evicted or killed under memory pressure.
Memory limitEnforced reactively with OOM kills when the kernel detects memory pressureToo low: OOMKilled restarts. Too high: no protection for neighbors.

The quality of service (QoS) class also follows from these settings: Guaranteed when every container's requests equal its limits for both CPU and memory, BestEffort when no requests or limits are set, and Burstable for everything in between. It matters later because an in-place resize can't change a pod's QoS class.

Step 1: Measure Usage Against Requests

Use at least a week of data so weekly patterns and batch jobs show up. With Prometheus scraping cAdvisor and kube-state-metrics (the standard kube-prometheus-stack setup), these queries give a high percentile of CPU, peak memory and current requests per container:

PromQL: p95 CPU cores used per container over 7 days

quantile_over_time(0.95,
  rate(container_cpu_usage_seconds_total{container!="", namespace="checkout"}[5m])[7d:5m]
)

PromQL: peak memory working set per container over 7 days

max_over_time(container_memory_working_set_bytes{container!="", namespace="checkout"}[7d])

PromQL: current CPU requests per container

kube_pod_container_resource_requests{resource="cpu", namespace="checkout"}

A reasonable starting point is CPU requests near the p90 to p95 of usage and memory requests near the observed peak plus a safety margin, then adjust per service. Memory deserves the bigger margin, because running out of CPU slows a container down while running out of memory gets it killed.

Step 2: Get Recommendations from VPA

VPA is an add-on, not part of core Kubernetes. It has three parts: the recommender, which analyzes usage; the updater, which applies changes by evicting pods or resizing them in place; and an admission webhook that sets requests on new pods. Run it in Off mode first, and bound its recommendations with minAllowed and maxAllowed:

vpa-checkout.yaml (recommendations only)

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: checkout
  namespace: checkout
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: checkout
  updatePolicy:
    updateMode: "Off"
  resourcePolicy:
    containerPolicies:
    - containerName: "app"
      minAllowed:
        cpu: 100m
        memory: 128Mi
      maxAllowed:
        cpu: "2"
        memory: 2Gi
      controlledResources: ["cpu", "memory"]
      controlledValues: RequestsOnly

Read the result with kubectl describe vpa checkout -n checkout. RequestsOnly tells VPA to change requests and leave limits alone; the default, RequestsAndLimits, scales limits in proportion to requests. To see recommendations for a whole namespace at once, Fairwinds' open source Goldilocks creates a VPA in recommendation mode for each workload and shows the results in a dashboard.

Step 3: Apply the New Requests

The safest path for most teams is to treat recommendations as input and commit new requests to Git, so they go through review and your normal GitOps rollout. Once you trust the numbers, let VPA apply them. These are the update modes:

VPA update modeBehaviorGood fit
OffCalculates recommendations; changes nothingStart here on every workload
InitialSets requests only when pods are created; never touches running podsWorkloads that restart often anyway, such as frequent deploys
RecreateEvicts pods whose requests differ significantly from the recommendationStateless services with enough replicas and a PodDisruptionBudget
InPlaceOrRecreateResizes running pods in place when it can, falls back to eviction when it can’t. GA in VPA 1.6.0Most workloads once recommendations look right; AKS recommends it over Recreate
InPlaceResizes in place only and never evicts; defers and retries instead. Alpha in VPA 1.7.0Pods that must not be evicted; test before production
AutoDeprecated since VPA 1.4.0; an alias for RecreateReplace with Recreate or InPlaceOrRecreate

In-place pod resize

In-place resize first appeared in Kubernetes 1.27 and has been stable since 1.35; the feature gate is now locked on. It needs a 1.33 or newer control plane, and the --subresource resize flag needs kubectl 1.32 or newer. Each container can say whether a change needs a restart:

Container resizePolicy

resizePolicy:
- resourceName: cpu
  restartPolicy: NotRequired
- resourceName: memory
  restartPolicy: RestartContainer

NotRequired is the default. With the policy above, a CPU-only change applies to the running container, and any change that includes memory restarts the container, which suits runtimes that can't release or grow memory on the fly. To resize manually:

Resize CPU on a running pod

kubectl patch pod checkout-7d9f -n checkout --subresource resize --patch \
  '{"spec":{"containers":[{"name":"app","resources":{"requests":{"cpu":"800m"},"limits":{"cpu":"800m"}}}]}}'

If the node can't fit the new size, the pod gets a PodResizePending condition with reason Infeasible (impossible on this node) or Deferred (retried later), and keeps its old resources. Limits to know about:

  • Only CPU and memory can be resized, and the QoS class can't change.

  • Windows pods don't support in-place resize, and pods under static CPU or Memory manager policies can't be resized in place.

  • Lowering a memory limit without a restart is best effort: if usage is above the new limit, the resize stays in progress.

  • Requests and limits can't be removed once set, and ephemeral containers can't be resized. Sidecar containers can.

VPA and HPA Together

The VPA project says it shouldn't be used with the Horizontal Pod Autoscaler on the same resource metric. If both react to CPU, VPA raises requests while HPA computes utilization against those requests, and the two fight. The supported combinations are VPA on memory with HPA on CPU, or HPA on custom and external metrics such as queue depth or requests per second. On GKE, Google points to multidimensional Pod autoscaling for this case.

GKE, AKS and Other Clusters

PlatformHow VPA is providedNotes
GKEEnabled by default in Autopilot clusters; configure it on Standard clustersInPlaceOrRecreate is in Preview and needs 1.34.0-gke.2201000 or later. Don’t combine with HPA on CPU; Google offers multidimensional Pod autoscaling instead. Keep fewer than 1,000 VPA objects per cluster.
AKSPreconfigured in AKS Automatic; optional and configured explicitly in AKS StandardInPlaceOrRecreate on AKS 1.34+. Optimal support up to 1,000 pods with VPA objects; recommender keeps up to eight days of history; no Windows containers; JVM workloads not supported.
Other clusters (including self-managed)Install the open source VPA from kubernetes/autoscaler, plus Metrics Server if the cluster doesn’t have itVPA reads usage from the metrics.k8s.io API, which Metrics Server provides.

After Pods, Rightsize Nodes

Smaller requests only save money when nodes are removed. Make sure your node autoscaler consolidates underused nodes, and check instance types against the new pod shapes. Our guides to Kubernetes cost optimization on EKS, GKE and AKS and Kubernetes unit economics cover the next steps, and Kubecost alternatives compares tools that report request-versus-usage waste by team. Disclosure: GetFinOps, our own product, finds waste and runs approved savings actions on AWS and Google Cloud.

Frequently Asked Questions

What is Kubernetes rightsizing?

Setting each container's CPU and memory requests (and limits) to match what it actually uses, with headroom. Because the scheduler and node autoscalers work from requests, rightsizing lets the same workloads run on fewer or smaller nodes.

Does in-place pod resize restart the container?

Not by default. resizePolicy defaults to NotRequired, so the change is applied to the running container. Set RestartContainer for memory if your runtime can't adjust its memory use without a restart.

Should I use VPA in automatic mode in production?

Start with Off, review the recommendations, then move workloads that tolerate it to InPlaceOrRecreate, with minAllowed and maxAllowed bounds and a PodDisruptionBudget for the eviction fallback.

Why do my pods get throttled when the node has spare CPU?

A CPU limit is a hard limit enforced by the kernel. When a container reaches it, it's throttled whether or not the node is busy. Check throttling metrics before lowering limits, and consider whether latency-sensitive services need a CPU limit at all.

Can VPA rightsize JVM applications?

Be careful. The AKS docs say VPA doesn't support JVM-based workloads because of limited visibility into their actual memory use, and the GKE docs say it isn't ready for them. Size the heap explicitly and set memory requests from it.

Paying for nodes your pods don't use?

We help US businesses rightsize Kubernetes on EKS, GKE and AKS: usage baselines, VPA rollout with safe bounds, HPA design and node consolidation, with every change reviewed in Git. The first 30-minute consultation is free.

Sources

See also: FinOps services · Cloud waste elimination · Service mesh comparison

HostingX Solutions LLC logo

HostingX Solutions LLC

FinOps, DevOps, and automation for US businesses.

info@hostingx.solutions

Subscribe to our newsletter

Get monthly email updates about improvements.


© 2026 HostingX Solutions LLC. All Rights Reserved.

LLC No. 0008072296 | Est. 2026 | New Mexico, USA

Legal

Terms of Service

Privacy Policy

Acceptable Use Policy

Security & Compliance

Security Policy

Service Level Agreement

Compliance & Certifications

Accessibility Statement

Privacy & Preferences

Cookie Policy

Manage Cookie Preferences

Data Subject Rights (DSAR)

Unsubscribe from Emails