Kubernetes Storage: PVC, StorageClass and CSI Provisioning
Kubernetes storage turns a workload request for durable data into a mounted volume through a PVC, a StorageClass, a PV, and a CSI driver. This guide explains binding, topology-aware provisioning, access modes, reclaim policy, expansion, snapshots, and stage-by-stage troubleshooting so a busy engineer can set the storage contract before the first production write.
Introduction
Kubernetes storage works when four decisions agree: the claim asks for the right capacity and access pattern, the StorageClass names a working provisioner, the volume is created in a place the Pod can run, and the reclaim policy matches the value of the data.
Consider an illustrative composite drawn from common production reviews, not a named incident. A team deploys a small internal service with a 20Gi PVC and no explicit StorageClass. In staging, the cluster default creates a volume quickly. In production, the same manifest lands on a cluster where the default class provisions immediately in one zone, while the Pod is constrained to another zone by node labels. The PVC binds, the Pod stays Pending, and the event says the Pod has a volume node affinity conflict. The team spends the first hour reading application logs even though the application never started. The failure is not mysterious once the stages are separated: provisioning succeeded in the wrong topology, so scheduling and storage disagreed.
The second half of the same composite is quieter. Months later, someone deletes a test namespace and expects the data to remain for inspection. The StorageClass used Delete, so the backend volume is removed with the PVC. Nothing malfunctioned. The platform executed the policy written in the class, but nobody had treated that policy as a data decision. Kubernetes storage failures often look like this: each controller does its job, while the contract between claim, class, topology, and deletion was never made explicit.
This is lesson 17 of the Kubernetes Roadmap Series, in Module 8 on storage. The Module 8 storage section places this lesson after topology spread constraints and Pod priority preemption and before StatefulSet storage patterns. That order matters. This lesson owns the storage primitives: PV and PVC binding, StorageClass policy, CSI provisioning, attach and mount flow, access modes, binding mode, reclaim policy, expansion, and generic snapshots. The next lesson owns StatefulSet patterns such as volumeClaimTemplates, headless Services, stable identity, and retain behaviour for per-replica claims.
The 5-minute takeaway
| Stage | Owner | Question to answer before production | Typical failure if skipped |
|---|---|---|---|
| Request | App team | How much storage, which access mode, filesystem or block? | PVC stays Pending or binds to the wrong kind of volume |
| Provision | Platform team and CSI driver | Which StorageClass, parameters, topology, and reclaim policy apply? | Volume is created in the wrong zone or deleted with the claim |
| Bind | PV controller | Does an available PV match class, capacity, mode, and selector? | Claim waits while a suitable-looking PV remains unusable |
| Attach and mount | Attacher, kubelet, node plugin | Can the selected node attach, stage, and publish the volume? | Pod sits in ContainerCreating with FailedAttachVolume or FailedMount |
| Recover | App and platform teams | How are expansion, snapshots, restore, and deletion tested? | Data exists until the first resize, delete, or restore request proves otherwise |
Read the table as a contract, not as a definition list. A PVC is not storage. A StorageClass is not storage. A bound PV is not yet a mounted filesystem. The workload is safe only when the request, the provisioned volume, the node placement, and the recovery path all describe the same data.
1. Kubernetes storage: separate the request, the volume, and the recipe
Kubernetes storage separates three jobs: a PersistentVolumeClaim requests storage from a namespace, a PersistentVolume represents cluster storage that can satisfy that request, and a StorageClass describes how new volumes should be provisioned when no suitable volume exists, before any Pod can mount durable data.
That separation is the core design. Application teams should not need to know whether the backend is a cloud disk, a Ceph volume, an NFS export, or a local device prepared by the platform team. They declare capacity, access mode, volume mode, and usually a StorageClass name. Platform teams decide which provisioner creates volumes, which parameters are allowed, whether deletion removes data, and whether binding waits for Pod placement. The PV is the meeting point between those two sides: cluster-scoped, bound to one PVC at a time, and independent of any single Pod lifetime.
Static provisioning means an administrator or automation creates PVs before claims arrive. Dynamic provisioning means a StorageClass and provisioner create a PV after a PVC appears. Static provisioning still fits special cases: pre-existing volumes, strict placement, shared file exports, or backends without a CSI provisioner. Dynamic provisioning is the normal path for cloud block storage and CSI-backed platforms because it removes manual PV bookkeeping. The operational difference is timing. With static provisioning, a missing or mismatched PV leaves the PVC Pending. With dynamic provisioning, a broken driver, bad parameter, quota limit, or backend permission error leaves the PVC Pending with provisioning events.
A Pod consumes storage by referencing a PVC as a volume and mounting it at a path, or by using a block volume device where the application manages the device directly. That reference is why storage problems surface as Pod problems. If the PVC is unbound, the Pod cannot start. If the volume is bound but cannot attach to the selected node, the Pod waits. If the mount succeeds but the application cannot write because of ownership or filesystem state, the Pod may start and fail for an application reason. Keep those layers separate during diagnosis. Binding, attaching, mounting, and writing are four different promises.
The object boundary also controls permissions. PVCs are namespaced, so application teams can request storage inside their namespace. PVs and StorageClasses are cluster-scoped, so platform teams control supply and policy. A good platform makes the safe path easy: a small set of named classes for clear tiers, explicit defaults, and documentation that says which class to use for single-writer block data, shared files, scratch-like durable data, and data that must survive claim deletion. A vague default class invites every workload to inherit decisions nobody reviewed.
2. Kubernetes storage: how PV and PVC binding really works
Kubernetes storage binding is a matching problem: the PV controller binds one PVC to one PV only when class name, capacity, access modes, volume mode, selector, and placement constraints can all be satisfied at the same time without guessing from Pod symptoms alone.
Start with the class name. A PVC that names a StorageClass can bind only to a PV with the same storageClassName, or to a PV dynamically provisioned for that class. A PVC with no storageClassName field can receive the cluster default StorageClass through admission defaulting when a default exists. A PVC with storageClassName set to an empty string is different: it asks for no class and can bind only to a PV whose class is also empty. That distinction explains a common surprise. Removing the field and setting an empty string are not the same request.
Capacity is a floor, not an exact size match. A PV must offer at least the storage requested by the PVC. A 50Gi PV can satisfy a 20Gi claim, and the bound PVC reports the PV capacity in its status. Dynamic provisioners may round up to backend increments, so the usable volume can be larger than the request. Do not design an application that assumes the requested size is the exact device size. Read the bound capacity and monitor actual filesystem or device usage.
Access modes and volume mode must also match. The PV must support the access modes requested by the PVC, and the volumeMode must agree. Filesystem is the default volume mode. Block means the Pod receives a raw block device path rather than a mounted filesystem. A PVC selector can narrow static matching by PV labels. Selectors are useful when an administrator pre-creates volumes for a known claim, but they also create a quiet failure mode: a PV with enough capacity and the right class still cannot bind if its labels do not match the selector.
Binding is exclusive. Once a PV is bound to a PVC, another PVC cannot claim it. The PV carries a claimRef to the bound claim. When the PVC is deleted, the PV moves to Released and keeps that claimRef until an administrator handles the data and clears the reference for reuse, or until the reclaim policy deletes the volume. A Released PV is not available for a new claim just because the old Pod is gone. Treat Released as a data-handling state, not as free capacity.
Prebinding is the deliberate version of the same mechanism. An administrator can create a PV with a claimRef pointing at a specific PVC, or create a PVC with a volumeName pointing at a specific PV. Use prebinding when the exact volume matters, such as a recovered volume or a preloaded dataset. For normal dynamic provisioning, let the controller match the claim to a newly created PV. In both cases, binding only pairs the objects. It does not prove the volume can attach to the Pod node or mount cleanly.
3. Kubernetes storage: design StorageClasses as platform policy
Kubernetes storage policy lives in the StorageClass: the provisioner selects the CSI driver, parameters pass driver-specific settings, reclaimPolicy decides deletion behaviour, volumeBindingMode controls timing, and allowVolumeExpansion decides whether claims may grow for every volume created from that class in a production cluster.
A StorageClass is a platform product surface. Application teams see a name such as fast, standard, shared, or retain. Behind that name, the platform team chooses the driver and the settings that become hard to change after data exists. Treat class names as promises. If a class says retain, its reclaim policy should retain. If a class is meant for zonal block storage, its binding mode should normally wait for the first consumer. If a class allows expansion, the driver and backend must actually support expansion for the volumes it creates.
The provisioner value must match the CSI driver name registered in the cluster. Parameters are passed to that driver; Kubernetes does not validate driver-specific keys for you. A parameter that one driver understands may be rejected or ignored by another. Put only documented parameters for your driver in the class, and test the class with a throwaway PVC before offering it to teams. The example values above show shape, not a universal recipe.
Mount options deserve the same discipline. A StorageClass can carry mountOptions that are applied to volumes created from the class. Invalid or unsupported options can turn a successful provision into a failed mount. Keep mount options minimal, driver-supported, and tested on the node operating systems in the cluster. If a filesystem option matters for performance or discard behaviour, prove it on a disposable volume and document why it is there.
Allowed topologies and the default class annotation complete the policy. allowedTopologies can restrict provisioning to nodes or zones described by topology labels. The annotation storageclass.kubernetes.io/is-default-class marks a class as default for PVCs that do not name one. Defaults are convenient and dangerous for the same reason: they hide a platform decision inside an omitted field. Keep one clear default, name non-default classes by intent, and review existing PVs before changing policy. A StorageClass change does not rewrite the reclaim policy or backend parameters of volumes that already exist.
4. Kubernetes storage: choose access modes and volume modes deliberately
Kubernetes storage access modes describe how a volume may be mounted: ReadWriteOnce allows one node, ReadWriteOncePod allows one Pod, ReadOnlyMany allows many read-only nodes, and ReadWriteMany allows many nodes to mount read-write for the workload that will mount it in production.
The most common misunderstanding is ReadWriteOnce. RWO means the volume can be mounted read-write by a single node. It does not always mean a single Pod. Multiple Pods on the same node may mount the same RWO filesystem volume, subject to the driver and filesystem. That can be useful for sidecars, but it can also hide a writer conflict. If the application requires one writer Pod, say so in the design and consider ReadWriteOncePod where the driver supports it. RWOP is stricter: only one Pod may mount the volume read-write.
| Access mode | Short name | Mount rule | Good fit | Main risk |
|---|---|---|---|---|
| ReadWriteOnce | RWO | Read-write on one node | Single-writer databases and most block volumes | Two Pods on one node can still fight over writes |
| ReadWriteOncePod | RWOP | Read-write by one Pod | Strict single-writer workloads | Driver support must be checked before use |
| ReadOnlyMany | ROX | Read-only on many nodes | Shared reference data and static content | Readers may cache stale data if updates are not coordinated |
| ReadWriteMany | RWX | Read-write on many nodes | Shared files with a suitable file backend | File locking and consistency become application problems |
Access mode is a capability request, not an application safety guarantee. RWX does not make concurrent writes safe. It only says the backend can mount the volume on many nodes. The application still needs locking, atomic rename rules, database semantics, or another coordination method. Many production incidents blamed on storage are really shared-file designs that assumed POSIX behaviour would solve multi-writer coordination. Choose RWX when the workload is built for shared files. Choose RWO or RWOP when one writer owns the data.
Volume mode is the second choice. Filesystem volumes are formatted and mounted as directories. Block volumes expose a raw device, and the application or a higher-level system manages the format. Block mode fits databases or storage engines that want direct device control, but it removes the convenience of a mounted path. Do not select block mode because it sounds faster. Select it when the software expects a device, handles filesystem creation or raw I/O itself, and has a tested recovery path.
A PVC can request more than one access mode, but production manifests should usually request the one mode the workload needs. Extra modes narrow the set of PVs and drivers that can satisfy the claim. Write the access pattern in the manifest and in the runbook: who writes, who reads, how many nodes may mount, and what happens during a rollout when old and new Pods overlap. That last question matters for RWO volumes during updates, because a new Pod on another node cannot attach a volume that is still attached elsewhere.
5. Kubernetes storage: use volumeBindingMode to put volumes in the right topology
Kubernetes storage placement depends on volumeBindingMode: Immediate provisions when the PVC is created, while WaitForFirstConsumer delays provisioning and binding until a Pod using the claim has been scheduled to a node in the topology where that volume can actually attach and mount.
Immediate binding is simple and sometimes correct. It fits storage that is not tied to a zone or node, and it makes a PVC bind before any Pod exists. The risk appears with zonal block storage. If the volume is created in one zone and the Pod later must run in another, the Pod cannot use the volume. The scheduler reports a volume node affinity conflict because the bound PV carries node affinity for the place where the backend volume exists. The PVC looks successful while the workload cannot start.
WaitForFirstConsumer changes the order. The PVC remains Pending until a Pod that uses it is created and scheduled. The scheduler selects a node while considering the claim, the selected node is recorded for provisioning, and the provisioner creates the volume in a topology compatible with that node. A Pending PVC with a WaitForFirstConsumer event is often normal. The real problem may be that no Pod uses the claim yet, or that the Pod cannot schedule because of resources, taints, affinity, or quotas. Debug the Pod and the PVC together.
This is where storage meets placement policy. The previous lesson on topology spread constraints and Pod priority preemption covered how Pods spread across failure domains. Storage adds a constraint in the other direction: once a zonal volume exists, future Pods using that claim must run where the volume can attach. A spread policy that assumes free placement will fail if every replica depends on volumes pinned to one zone. Design placement and storage as one decision for stateful workloads.
Allowed topologies can narrow provisioning further. A StorageClass may restrict volumes to selected zones or node label values, and CSI drivers report topology segments such as zone or region. Use those controls to keep data inside approved locations, but test the failure message when no eligible node exists. A class that is too narrow produces Pending PVCs that look like driver failures. The fix is not to retry harder. The fix is to align node labels, scheduler constraints, class topology, and backend availability.
For most zonal CSI block storage, WaitForFirstConsumer is the safer default. For shared file storage that can mount across zones, Immediate may be acceptable. The decision rule is physical: if the backend volume has a location, delay creation until Kubernetes knows where the first consumer will run. If the backend has no meaningful location constraint, immediate binding removes one moving part.
6. Kubernetes storage: trace CSI provisioning from PVC to PV
Kubernetes storage provisioning through CSI starts when the external-provisioner sees an unbound PVC, calls the driver controller CreateVolume operation, receives a backend volume handle, and creates a PV that the PV controller can bind without treating the claim itself as storage.
CSI splits the driver into services. The Identity service reports plugin name and capabilities. The Controller service performs cluster-level operations such as CreateVolume, DeleteVolume, ControllerPublishVolume, CreateSnapshot, and ControllerExpandVolume. The Node service performs node-local operations such as NodeStageVolume and NodePublishVolume. Kubernetes sidecars translate API objects into CSI calls so the driver does not need to watch Kubernetes directly. The external-provisioner is the sidecar that turns PVCs into CreateVolume calls for the StorageClass provisioner it serves.
The request carries more than size. The provisioner sends a volume name, capacity range, access mode and volume mode capabilities, StorageClass parameters, and accessibility requirements derived from topology. For WaitForFirstConsumer classes, provisioning waits for the selected node information so the driver can create the volume in the right topology. The driver talks to the storage backend and returns a volume ID and attributes. The external-provisioner then creates a PV with the CSI driver name, volumeHandle, attributes, capacity, access modes, reclaim policy from the class, and node affinity when the backend volume is topology-bound.
Idempotency matters because controllers retry. A provisioner may call CreateVolume again after a timeout or leader change. CSI drivers are expected to handle repeated create requests for the same volume name safely. Operators should still avoid manual cleanup during a provisioning retry unless they understand the backend state. Deleting a backend volume while the provisioner is reconciling can create a PV that points at missing storage or a backend volume that no PV owns.
Provisioning failures leave evidence. A missing StorageClass produces a clear event. A missing or unhealthy provisioner leaves the claim waiting for external provisioning. Backend permission errors, quota limits, invalid parameters, and unsupported access modes appear in PVC events or provisioner logs. Read the PVC events first, then check the CSI controller Pods and logs for the driver named by the StorageClass. Do not start by deleting the PVC. A Pending claim is often the record that explains why storage did not appear.
Static PVs skip this flow. No CreateVolume call happens because the PV already exists. That makes static provisioning predictable for pre-created storage, but it moves capacity planning and cleanup to administrators. Dynamic provisioning moves those tasks into the driver and class policy. Either way, the PVC binds to a PV object. The difference is who created the PV and who owns the backend lifecycle after binding.
7. Kubernetes storage: separate attach, stage, and publish
Kubernetes storage reaches a Pod in stages: the scheduler assigns the Pod, the attach path connects the volume to the node when required, kubelet asks the node plugin to stage the volume, and publish exposes it inside the Pod for the workload process.
Attach is a controller-side operation for drivers that need it. When a Pod is scheduled to a node, the attach-detach controller creates a VolumeAttachment object for the PV and node. The external-attacher watches that object and calls ControllerPublishVolume on the CSI controller service. The driver asks the backend to attach the volume to the node. Some drivers, especially file drivers, may not require a separate attach step. The CSIDriver object and driver documentation say whether attach is required.
Stage and publish are node-local. After attach succeeds, kubelet calls the node plugin through the CSI socket registered on that node. NodeStageVolume prepares the volume at a global staging path on the node, which can include mounting a filesystem once for that node. NodePublishVolume then exposes the staged volume at the Pod target path, usually with a bind mount for filesystem volumes or a device path for block volumes. The node-driver-registrar registers the plugin with kubelet so kubelet knows where to send those calls. This split is part of the wider control-plane and node-agent pattern described in Kubernetes architecture and workload orchestration.
The stage split explains error names. FailedAttachVolume points at the attach path: backend attach limits, a volume still attached to another node, missing permissions, or a driver controller problem. Multi-Attach errors usually mean an RWO volume is already attached elsewhere and the old attachment has not cleared. FailedMount points later: the device did not appear, the filesystem could not mount, mount options were invalid, the node plugin was unhealthy, or the staging path had a problem. A Pod in ContainerCreating with a bound PVC is often waiting in one of these stages.
Termination reverses the path. Kubelet unpublishes the volume from the Pod, unstages it when no Pod on the node needs it, and the attacher unpublishes the volume from the node after the VolumeAttachment is removed. Forced deletion of Pods or nodes can leave attachments behind. Force detach is a recovery action with data risk, because the old node may still believe it owns the device. Confirm the old Pod and node are truly gone before forcing storage movement.
Rollouts expose the same mechanics. A Deployment update that creates a new Pod before the old Pod releases an RWO volume can stall if the new Pod lands on another node. Recreate strategy, careful surge settings, or a workload controller designed for stable identity may be required. Storage choice therefore affects rollout design. A volume that can mount on only one node cannot support a rollout pattern that assumes old and new Pods run anywhere at the same time.
8. Kubernetes storage: set reclaim policy before data matters
Kubernetes storage deletion is governed by reclaim policy: Delete removes the PV and backend volume after the PVC is deleted, while Retain keeps the PV and data in Released state for manual handling after the last Pod using it has stopped.
The reclaim policy is copied to dynamically provisioned PVs from the StorageClass. Delete is the default for dynamic provisioning unless the class sets Retain. That default is convenient for ephemeral and rebuildable data. It is dangerous for data that must survive namespace cleanup, claim replacement, or an operator mistake. Decide the policy by data value, not by environment name alone. A staging database with the only copy of a test dataset may still need Retain. A production cache that can rebuild from source may safely use Delete.
PVC protection delays deletion while a Pod uses the claim. The kubernetes.io/pvc-protection finalizer keeps the PVC in Terminating until no Pod uses it. That protects running workloads from losing a claim object mid-flight, but it does not make Delete safe after the Pod stops. Once the PVC is deleted, a Delete PV is removed and the provisioner deletes the backend volume. A Retain PV becomes Released. The data remains, but the PV will not bind to a new PVC until an administrator inspects the volume, copies or wipes data as required, and clears the old claimRef.
Changing a StorageClass reclaim policy does not change existing PVs. Each PV carries its own persistentVolumeReclaimPolicy. If a volume was created with Delete and the data later becomes important, patch the PV policy to Retain before deleting the PVC, and verify the change. The reverse also matters: a Retain PV left after an incident needs an owner and a cleanup date, or retained volumes become unowned data with cost and compliance risk.
Retain is not a backup. It only stops automatic deletion. The backend volume can still fail, be deleted by a cloud administrator, expire under a lifecycle rule, or become unreadable after a driver change. Pair Retain with snapshots, application backups, restore tests, and an inventory of released volumes. The older Recycle policy is deprecated and should not be used for new designs. Use Delete for disposable data and Retain for data that needs a human decision before destruction.
Deletion runbooks should name the exact objects. Record the PVC name and namespace, the PV name, the StorageClass, the backend volume ID, the reclaim policy, the snapshot or backup taken before deletion, and the person approving destruction. That record sounds heavy until the first namespace cleanup deletes the wrong claim. Storage deletion is a data operation. Treat it with the same care as a database drop.
9. Kubernetes storage: expand volumes without pretending shrink exists
Kubernetes storage expansion only grows a volume: the StorageClass must allow expansion, the CSI driver must support it, the PVC request may increase, and the filesystem may need a second node-side resize before Pods see the space inside the running workload.
Expansion starts by increasing spec.resources.requests.storage on the PVC. The request cannot shrink. If allowVolumeExpansion is false on the StorageClass, the update is rejected. If the class allows expansion but the driver does not support the required CSI expansion operations, the resize fails or stalls. Resource quotas can also block the update when the namespace storage quota would be exceeded. Check class, driver capability, backend limits, and quota before promising a resize window.
The external-resizer watches PVC size increases and calls ControllerExpandVolume. That grows the backend volume. For filesystem volumes, the node may still need to grow the filesystem. The PVC can show a FileSystemResizePending condition while kubelet calls NodeExpandVolume on the node where the volume is used. Some drivers and filesystems resize online. Others require the Pod to restart or the volume to be remounted. The PVC status capacity and the space reported inside the Pod are related but not identical signals; verify both.
Plan expansion before the volume is full. A filesystem at 100 percent can block writes, corrupt application state, or prevent the very Pod restart needed to finish a resize. Alert on usage and growth rate, not only on a fixed threshold. Keep enough headroom for logs, compaction, temporary files, and snapshot metadata where the backend counts them. Expansion is a normal operation only when it is rehearsed on a non-production volume with the same driver and filesystem.
Shrink requests need a migration plan. Create a new smaller volume, copy data with application-aware tooling, verify checksums or database consistency, cut over, and retain the old volume until rollback is no longer needed. Do not edit a PVC downward and expect Kubernetes to negotiate with the filesystem. The API contract is growth only because shrinking a live filesystem and block device safely is a different problem.
10. Kubernetes storage: treat snapshots as recovery points, not backups
Kubernetes storage snapshots are CSI-backed point-in-time copies: a VolumeSnapshot requests a copy of a PVC, a VolumeSnapshotClass selects the driver and deletion policy, and a new PVC can restore from the snapshot when the driver supports it for a tested recovery workflow.
Snapshots require more than a StorageClass. The cluster needs the snapshot custom resources, the snapshot controller, the external-snapshotter sidecar for the driver, and a CSI driver that implements snapshot operations. The VolumeSnapshotClass names the driver and carries driver parameters plus a deletionPolicy. Delete removes the backend snapshot when the VolumeSnapshot is deleted. Retain keeps the snapshot content for manual handling. Choose that policy with the same care as PV reclaim policy.
Restore creates a new PVC with dataSource pointing at the VolumeSnapshot. The new claim should request at least the snapshot restore size and use a StorageClass handled by a compatible driver. Some drivers also support cloning from an existing PVC through dataSource. Clone and snapshot support are driver capabilities, not universal Kubernetes promises. Test restore into a scratch namespace and start the application against the restored volume before calling the snapshot useful.
Consistency is the hard part. A storage snapshot is usually crash-consistent unless the application is quiesced or the backup tool coordinates with the database. Crash-consistent means the volume looks like it would after a sudden power loss. Many databases can recover from that state, but recovery is not the same as a clean backup. For databases, prefer native backup tooling or a snapshot workflow that flushes and fences writes correctly. For file workloads, stop writers or use application-level export when torn files would be unacceptable.
A snapshot is not automatically a backup. It may live on the same storage system, in the same account, under the same deletion permissions, and with the same failure domain as the source volume. Backups need retention, separation, encryption, access control, and restore tests. Snapshots are excellent for fast rollback before a risky change and for cloning test data. They become part of a backup strategy only when copies leave the failure domain and restores are proven.
11. Kubernetes storage: troubleshoot by stage, not by guessing
Kubernetes storage troubleshooting should follow the stage that failed: read PVC events for binding and provisioning, Pod events for scheduling and mount failures, VolumeAttachment objects for attach state, and driver logs for backend errors before changing any objects in the cluster.
Start with the claim, not the application. A Pending PVC tells you whether binding is waiting for a consumer, a StorageClass is missing, a provisioner is failing, or no static PV matches. A bound PVC with a Pending Pod points toward scheduling, topology, attach, or mount. A Running Pod that cannot write points toward filesystem permissions, application paths, quotas, or data corruption. Each stage has different evidence.
| Symptom or event | Stage | First checks | Fix direction |
|---|---|---|---|
| storageclass not found | Binding | PVC storageClassName and kubectl get storageclass | Create the class or correct the claim |
| no persistent volumes available and no storage class is set | Binding | Default class, static PV class, capacity, access mode, selector | Add a default class or a matching PV |
| waiting for first consumer | Binding and scheduling | Pod exists, Pod scheduling events, selected-node annotation | Fix Pod placement or create the consumer Pod |
| waiting for external provisioner | Provisioning | CSI controller Pods, driver logs, backend permissions, quota | Repair driver, credentials, parameters, or quota |
| volume node affinity conflict | Scheduling | PV node affinity, Pod node constraints, class binding mode | Move the Pod to the volume topology or recreate storage correctly |
| FailedAttachVolume or Multi-Attach | Attach | VolumeAttachment, old Pod and node state, attach limits | Wait for clean detach or recover the stuck attachment carefully |
| FailedMount | Stage and publish | Node plugin health, device visibility, filesystem state, mount options | Fix node plugin, filesystem, or class mount options |
| FileSystemResizePending | Expansion | PVC conditions, Pod node, driver node expansion support | Let kubelet resize or restart the Pod if the driver requires it |
| PV stuck Released | Reclaim | PV claimRef, reclaim policy, data handling record | Copy or wipe data, then clear claimRef only when safe |
Events expire, so capture them during the incident. For command habits that keep output readable under pressure, use the kubectl master guide patterns: describe the object that owns the state, sort events by time, and avoid deleting the evidence before reading it. If the Pod starts and then restarts because the application cannot use the mounted path, storage may have done its job and the failure has moved into application configuration.
The fastest triage question is: what is the last successful stage? If there is no PV, provisioning or static matching failed. If there is a PV but no binding, matching failed. If the PVC is Bound but no VolumeAttachment appears, scheduling or attach setup failed. If the attachment is ready but the Pod cannot mount, inspect the node. That sequence prevents the common waste of restarting Pods for a missing StorageClass or editing a StorageClass for a node plugin failure.
12. Kubernetes storage: run the production checklist before the first real write
Kubernetes storage is production-ready only after the team proves the full lifecycle: provision, bind, attach, mount, write, expand, snapshot, restore, delete, and retain or destroy the volume according to policy without surprises during an incident or a routine namespace cleanup later.
Use this checklist before the first real write:
- Name the StorageClass explicitly in the PVC unless the default class is reviewed and intentional.
- Match access mode and volume mode to the writer pattern, rollout pattern, and node placement pattern.
- Use WaitForFirstConsumer for topology-bound block storage unless Immediate binding is proven safe.
- Set reclaim policy by data value, and record who may approve PVC deletion.
- Confirm allowVolumeExpansion and driver expansion support with a disposable volume.
- Create a snapshot, restore it to a new PVC, start the workload, and verify data before relying on snapshots.
- Alert on Pending PVC age, provisioning failures, volume usage, growth rate, attach errors, and Released PVs without an owner.
- Document the backend volume ID, owner, data classification, backup method, restore owner, and deletion approval path.
- Test namespace deletion in a non-production cluster and confirm the result matches the reclaim policy.
- Keep enough free space for application compaction, logs, temporary files, and resize operations.
The checklist is deliberately boring. Storage rewards boring preparation and punishes clever shortcuts. A class that provisions quickly but deletes data by default is not production-ready for valuable data. A snapshot that has never been restored is a hope, not a recovery path. A volume that binds in staging but cannot attach under production node constraints is not portable. Prove each stage on the same driver, node image, filesystem, and topology rules that production uses.
Choose the workload controller after the storage contract is clear. The Deployment vs StatefulSet vs DaemonSet comparison covers controller identity and rollout behaviour, while this lesson covers the volume underneath the Pod. For shared production habits around requests, probes, and change control, pair this checklist with Kubernetes best practices. The next roadmap lesson then builds on this base with StatefulSet storage patterns, where each replica receives its own claim and identity rules become part of the storage design.
The senior SRE habit is to write the storage contract in plain language before applying YAML. State the data owner, writer count, topology limit, deletion rule, resize rule, snapshot rule, and restore proof. If any sentence is vague, the manifest is not ready. Kubernetes will faithfully execute the policy you give it, including the policy you forgot you accepted.
Frequently Asked Questions
What is Kubernetes storage in simple terms?
Kubernetes storage is the set of objects and controllers that turn a workload request for durable data into a mounted volume. The PVC asks for storage, the StorageClass describes provisioning policy, the PV represents the bound storage, and the CSI driver creates, attaches, and mounts the backend volume.
How does Kubernetes storage bind a PVC to a PV?
Kubernetes storage binds a PVC to a PV when the class name, capacity, access modes, volume mode, selector, and placement constraints match. Dynamic provisioning creates a PV for the claim through the StorageClass provisioner. Static provisioning requires an available PV that already satisfies the claim.
Why is my Kubernetes storage PVC stuck Pending?
A Kubernetes storage PVC stays Pending when no PV matches and no provisioner creates one. Common causes are a missing StorageClass, no default class, a WaitForFirstConsumer class with no schedulable consumer Pod, a broken CSI provisioner, backend quota or permission errors, or a static PV mismatch. Read the PVC events first.
What is the difference between Immediate and WaitForFirstConsumer in Kubernetes storage?
Immediate binding provisions storage when the PVC is created. WaitForFirstConsumer delays provisioning and binding until a Pod using the PVC is scheduled, so topology-bound volumes are created where the Pod can run. Use WaitForFirstConsumer for zonal block storage unless Immediate is proven safe.
Does ReadWriteOnce in Kubernetes storage mean only one Pod can use the volume?
No. ReadWriteOnce means the volume can be mounted read-write by one node. Multiple Pods on that same node may mount it, depending on the driver and filesystem. Use ReadWriteOncePod when the workload requires exactly one Pod to mount the volume read-write and the driver supports it.
What happens to Kubernetes storage when a PVC is deleted?
When a PVC is deleted, the PV reclaim policy decides the outcome. Delete removes the PV and backend volume. Retain keeps the PV in Released state with its data until an administrator copies, wipes, or reuses it deliberately. PVC protection delays deletion while a Pod still uses the claim.
Can Kubernetes storage volumes be expanded or shrunk?
Kubernetes storage volumes can be expanded when the StorageClass allows expansion and the CSI driver supports it. Expansion increases the PVC request and may require a node-side filesystem resize. Shrinking is not supported through PVC resize; create a smaller volume and migrate data with application-aware tooling.
Preparing for Senior Platform & SRE Interviews
Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.
Explore Interview Scenarios →