Vertical Pod Autoscaler (VPA) Tuning Prompt
Roll out the Vertical Pod Autoscaler safely — recommendation-only mode, update policies, container resource bounds, and the HPA coexistence trap — to right-size requests without restart storms.
- Target user
- SREs right-sizing CPU/memory requests on Kubernetes
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior SRE who has used the Vertical Pod Autoscaler to right-size hundreds of workloads while avoiding the eviction storms that scare teams off VPA. I will provide: - The Deployment/StatefulSet spec (current requests/limits) - Whether an HPA already targets this workload - Workload profile (steady, bursty, batch, JVM/heap-bound, sidecar-heavy) - VPA version and whether the admission controller is installed - Goal (cut over-provisioning, stop OOMKills, set sane defaults for a new app) Work through this methodically: 1. **Mode selection** — explain `updateMode: Off` (recommendation only), `Initial`, `Recreate`, and `Auto`. Tell me which to start with and why "Off" is almost always the right first move. Show how to read `status.recommendation` (target, lowerBound, upperBound, uncappedTarget). 2. **The HPA conflict** — VPA and HPA must NOT both act on CPU/memory for the same workload. Explain the supported pattern (HPA on a custom/external metric, VPA on memory only, or VPA Off + manual apply) and how to avoid the fighting-controllers failure. 3. **Container bounds** — set `resourcePolicy.containerPolicies` with `minAllowed`/`maxAllowed` per container; carve out sidecars with `mode: "Off"`; explain `controlledResources` and `controlledValues` (RequestsOnly vs RequestsAndLimits). 4. **JVM / runtime gotchas** — why memory recommendations mislead for heap-bound apps; aligning `-Xmx`/`MaxRAMPercentage` with the recommended request; CPU throttling vs request. 5. **Eviction safety** — how `Recreate`/`Auto` evict pods to apply changes; pair with a PodDisruptionBudget; rate of disruption; quiet windows. 6. **Rollout plan** — run Off for 1-2 weeks, harvest recommendations, diff against current requests, apply via a PR (not live mutation), then optionally graduate to Auto for non-critical tiers. 7. **Validation** — measure utilization before/after, OOMKill rate, CPU throttle %, and cost delta. Output as: (a) a VPA manifest in `Off` mode with container bounds, (b) a decision table for which mode fits which workload, (c) the HPA-coexistence config if applicable, (d) a 3-phase rollout with go/no-go gates, (e) the exact metrics to watch. Be conservative: prefer recommendation-only + reviewed PRs over live `Auto` mutation on anything user-facing.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Kubernetes In-Place Pod Resize Design Prompt
Adopt in-place Pod vertical resize (resizePolicy, resize subresource) so containers get more CPU/memory without a restart — and know when it silently falls back to a recreate.
-
Resource Requests, Limits and HPA Right-Sizing Prompt
Right-size cpu/memory requests and limits from observed usage and pair them with a sane HPA so a workload scales on the correct signal without thrashing or OOMing.
-
Kubernetes Karpenter NodePool & Disruption Budget Tuning Prompt
Design and tune Karpenter NodePool, EC2NodeClass, and disruption/consolidation policies so the cluster bin-packs aggressively without churning workloads or violating PDBs.
-
Kubernetes KEDA Event-Driven Autoscaling Prompt
Scale Kubernetes workloads on real event sources — queue depth, Kafka lag, cron, Prometheus queries — with KEDA, including scale-to-zero, ScaledObject/ScaledJob design, and avoiding flapping or stuck consumers.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.