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 changesInitial: 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 likeRecreate
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 recommendationscontrolledResources: Specify whether to managecpu,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.