The StorageClass decides when to create the volume The db app requested a 10Gi PVC. When the actual volume is created is set by the StorageClass binding mode (volumeBindingMode).
There are two choices: Immediate creates it as soon as the PVC exists, and WaitForFirstConsumer creates it when a Pod using that PVC is placed on a node.
Immediate creates it without knowing the Pod's node Immediate creates the volume before deciding where the Pod goes. For node-bound storage like a local disk, it may land on any node.
If the volume is created on a node other than the one the Pod lands on, the Pod can never attach it and never starts.
Watch out Immediate suits network storage that every node can reach.
WaitForFirstConsumer creates it after the Pod is placed In this mode a new PVC stays Pending until a Pod appears. Events show a message meaning "waiting for first consumer". This is normal.
Once the Pod exists and the scheduler picks node-1, the volume is created on node-1's disk. The Pod and the volume end up on the same node.
Key idea Use WaitForFirstConsumer for location-sensitive storage like local disks. Local Path Provisioner (e.g. Rancher local-path) is this kind of local disk setup.
A local volume shares its node's fate node-1 fails. The data lives only on node-1's disk, so moving the db Pod to node-2 leaves no volume to attach.
The Pod cannot start until node-1 returns. If the disk is damaged too, the data is lost.
Watch out A database on local volumes needs its own replication, with replicas spread across nodes.
Network storage is reattached to another node Had the same db used network storage, you detach the volume from node-1 and attach it to node-2. The data stays on the storage system.
But an RWO volume is not attached to a new node until detachment from node-1 is confirmed. So the Pod may sit in ContainerCreating for minutes.
Key idea Kubernetes cannot tell whether the node is truly dead or just cut off from the network. This wait is not a bug; it prevents data corruption.
What changed in this step
~ volume attach node-1 → node-2RWO means "one node", not "one Pod" After recovery, db replicas go from 1 to 2, and only the Pod on node-2 sits in ContainerCreating. The RWO (ReadWriteOnce) volume is already attached to node-1.
Pods on the same node can share an RWO volume. To use it from several nodes, you need storage that supports RWX (ReadWriteMany).
Watch out To limit it to a single Pod, use RWOP (ReadWriteOncePod). If you request an access mode the StorageClass does not support, the PVC stays Pending.
Capacity can only grow If the StorageClass has allowVolumeExpansion: true, you can grow the volume by changing the PVC size from 10Gi to 20Gi.
Shrinking is not supported. Depending on the driver, the Pod may need a restart before the file system grows too.
What changed in this step
Snapshots are fast but do not replace backups A snapshot captures a volume's state at a point in time, inside the storage system. It needs VolumeSnapshot and VolumeSnapshotClass resources plus the snapshot controller.
It usually lives on the same system, so if that system fails the snapshot can be lost too. To be safe, keep backups somewhere else.
Watch out Installing a CSI driver is not enough: without the snapshot controller and a VolumeSnapshotClass, snapshots do not work. Check kubectl get volumesnapshotclass first.
They look the same day to day, but differ in failures Binding mode decides when the volume is created. Storage type decides whether a Pod can move on node failure. Access mode decides how many nodes can attach it.
Some Pending and ContainerCreating states are normal waits. Event messages tell a wait apart from a failure.
Summary Binding mode, storage type and access mode decide behavior in a failure. If a PVC is Pending, check the events in kubectl describe pvc to tell a normal wait from a failure.