- How many StorageClasses exist in the cluster?
- Which StorageClass does not support dynamic provisioning?
kubernetes.io/no-provisioner provisioner will not dynamically provision volumes. In the example output above, local-storage uses kubernetes.io/no-provisioner, so it does not support dynamic provisioning and relies on pre-provisioned PVs.
- What is the volume binding mode for the
local-storageStorageClass?
local-storage uses the WaitForFirstConsumer volumeBindingMode. This delays binding until a Pod that consumes the PVC is scheduled, ensuring the PV is bound on a node that actually has access to the underlying local storage.
- What is the provisioner for the StorageClass named
portworx-io-priority-high?
portworx-io-priority-high is kubernetes.io/portworx-volume.
- Is there a PersistentVolumeClaim consuming the PersistentVolume named
local-pv?
local-pv; the PV is Available and unbound.
- Create a PersistentVolumeClaim named
local-pvcthat should bind tolocal-pv
- Request the same or smaller capacity than the PV.
- Use a compatible access mode (e.g.,
ReadWriteOnce). - Specify the same
storageClassNameas the PV (local-storagein this example).
pvc.yaml:
- Why is the PVC in Pending even though the PV exists and matches?
local-storage uses volumeBindingMode: WaitForFirstConsumer, binding is intentionally delayed until a Pod that consumes the PVC is created and scheduled. The PVC remains Pending until an associated Pod exists so the scheduler can ensure the Pod is placed on a node that can access the PV.
StorageClasses with
WaitForFirstConsumer delay binding (and dynamic provisioning) until a Pod uses the PVC. This is typical for local volumes to ensure the PV is bound on a node that actually has the storage.- Create a Pod that consumes
local-pvc
nginx-pod.yaml that mounts the claim at /var/www/html:
Pending to Bound and the PV becomes bound to the claim.
- Create a new StorageClass
delayed-volume-scthat usesno-provisionerand delayed binding
delayed-volume-sc.yaml:
delayed-volume-sc StorageClass uses the no-provisioner provisioner and WaitForFirstConsumer binding, suitable for clusters that rely on pre-provisioned local PVs and want to delay binding until Pod scheduling.
Links and references
