Course contentsShow
← Cloud and Infrastructure
Lesson 1456 of 2,98929. Kubernetes ObservabilityFree lesson

VPA Configuration and Policies

Defining VPA resources with update policies, controlling which containers to target, and setting bounds on recommendations.

VPA Configuration and Policies

What you'll learn: How to fine-tune Vertical Pod Autoscaler behavior by defining update policies, targeting specific containers, and constraining resource recommendations.


Core Idea

While VPA can automatically recommend or apply resource adjustments (as you learned in VPA Basics), you need policies to control how and when it acts. VPA resources let you specify which containers to adjust, whether changes happen automatically or require manual intervention, and what limits to place on recommendations. Think of it like setting guardrails on a self-driving car—you define the boundaries within which VPA can operate safely.


VPA Update Policies

The updateMode field controls VPA behavior:

  • Off: VPA only recommends; never applies changes
  • Initial: Sets resources only when Pods are created (not on existing Pods)
  • Recreate: Evicts Pods to apply new resource values (disruptive but effective)
  • Auto: Currently behaves like Recreate

Targeting Specific Containers

Use containerPolicies to control which containers VPA manages and set boundaries:

  • containerName: Target specific containers (or use * for all)
  • minAllowed / maxAllowed: Hard limits on resource recommendations
  • controlledResources: Specify whether to manage cpu, memory, or both

This prevents VPA from over-provisioning critical workloads or under-provisioning resource-hungry containers.


Recommendation Bounds

Setting minAllowed and maxAllowed ensures VPA's recommendations stay within acceptable ranges—like telling an advisor "never suggest less than 100m CPU or more than 2 cores." This protects against both starvation and wasteful over-allocation.


Key Takeaway:
VPA configuration policies give you precise control over automatic resource adjustments through update modes, container-level targeting, and recommendation boundaries—ensuring safe, predictable autoscaling behavior.