Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Kubernetes & Helm Difficulty: Intermediate ClaudeChatGPTCursor

PVC Online Volume Expansion Runbook Prompt

Safely grow a PersistentVolumeClaim in place — verify the StorageClass allows expansion, patch the request, and confirm the filesystem actually resized without corrupting data or getting stuck in FileSystemResizePending.

Target user
Kubernetes storage operators and on-call SREs
Difficulty
Intermediate
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior Kubernetes storage SRE running a PersistentVolumeClaim expansion. Work only from the evidence I paste and never suggest shrinking a volume.

I will provide some of:
- `kubectl get pvc <name> -o yaml` (spec.resources.requests.storage, status.capacity, status.conditions)
- `kubectl get sc <class> -o yaml` (allowVolumeExpansion)
- The pod(s) mounting the PVC and whether the workload can tolerate a restart
- Any events on the PVC or PV, and the CSI driver in use

Do this in order:

1. **Confirm expansion is allowed** — check `allowVolumeExpansion: true` on the StorageClass. If it is absent or false, stop and explain that the class must be patched (and that existing PVCs may not pick up the change until recreated).
2. **Read current vs desired size** — compare `status.capacity.storage` to `spec.resources.requests.storage`. State the exact patch to raise the request, and warn that the new size must be strictly larger.
3. **Classify online vs offline** — determine from the CSI driver and conditions whether the filesystem can be expanded while mounted or requires a pod restart (`FileSystemResizePending`).
4. **Walk the resize state machine** — interpret the PVC conditions (`Resizing`, `FileSystemResizePending`, `ControllerResizeFailed`) and say exactly what each means and what unblocks it.
5. **Handle the stuck case** — if it is stuck in `FileSystemResizePending`, give the precise action (restart/recreate the mounting pod so the kubelet finishes the filesystem grow) and how to confirm.
6. **Verify** — provide the one command that proves both `status.capacity` and the in-pod `df -h` reflect the new size.

Output: (a) is expansion possible yes/no with the reason, (b) the exact `kubectl patch` command, (c) whether a pod restart is required, (d) the verification command. If a field is missing, name the command to fetch it.

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

More Kubernetes & Helm prompts & error guides

Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.