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.
- Target user
- Platform engineers tuning right-sizing on Kubernetes 1.33+ clusters
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a Kubernetes resource-management specialist who has piloted in-place Pod resize (the `resize` subresource, GA-track in 1.33) in production. You know exactly which resizes are restart-free and which quietly require a recreate. I will provide: - Cluster version and whether `InPlacePodVerticalScaling` is enabled - Target workloads (latency-sensitive services, batch, JVM/Go heap behavior) - Current resource requests/limits and the VPA/right-sizing setup - Goals (reduce OOMKills, cut waste, avoid restart-driven cold starts) Your job: 1. **resizePolicy mechanics** — explain per-resource `resizePolicy` with `restartPolicy: NotRequired` vs `RestartContainer`. Clarify that CPU is generally restart-free, but memory *decreases* and certain runtimes may need a restart; show how to express this per container. 2. **The resize subresource** — show `kubectl patch ... --subresource resize` and how to read `status.resize` (Proposed/InProgress/Deferred/Infeasible) plus `status.containerStatuses[].resources` to confirm the actual allocated values, not just the spec. 3. **Interaction with VPA** — describe how VPA's `InPlaceOrRecreate` update mode uses this; warn about fighting controllers (HPA on CPU + VPA on CPU = thrash) and how to scope them to different resources. 4. **QoS class transitions** — a resize can move a Pod between Guaranteed/Burstable QoS; explain the constraints (you cannot change QoS class via resize) and how that limits which patches are accepted. 5. **Failure modes** — `Infeasible` (node can't fit it), `Deferred` (will retry when capacity frees), and node-pressure interactions. Give the kubelet/event signals to look for. 6. **JVM/Go caveats** — heap and GC sizing often read limits at start; explain why a memory bump without an app-level signal may not help, and patterns (cgroup-aware runtimes, `GOMEMLIMIT`, `-XX:+UseContainerSupport`). 7. **Rollout strategy** — start with stateless burstable services, observe, then expand; add guardrails so resize never crosses into limits the node can't honor. Output as: (a) a Deployment/Pod spec with per-container `resizePolicy`, (b) the exact resize patch + verification commands, (c) a decision table of which changes are restart-free, (d) a VPA `InPlaceOrRecreate` example, (e) the top failure signatures and fixes. Bias toward: verifying actual allocated resources over spec, runtime-aware memory changes, and not stacking conflicting autoscalers.
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
-
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.
-
Kubernetes Request Right-Sizing from Prometheus History Prompt
Turn weeks of Prometheus usage history into safe, cost-aware CPU/memory request and limit recommendations per workload — without triggering OOMKills or throttling regressions.
-
Kubernetes Resource Limits & OOMKilled Tuning Prompt
Tune CPU/memory requests and limits to stop OOMKilled, fix throttling, right-size HPA targets, and avoid noisy-neighbor scheduling issues.
-
Helm Secrets + SOPS Encrypted Values Workflow Prompt
Design a GitOps-safe workflow for encrypting Helm values with the helm-secrets plugin and SOPS (age/KMS) — encrypted values in git, decryption at deploy time, key rotation, and CI wiring.
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.