storageClassName is the PersistentVolumeClaim field that selects the StorageClass used to provision requested persistent storage. A cluster may offer several classes for different performance, access-mode, or storage-backend needs; one is usually marked as the default. section 10.2.5
Selecting a storage class
A claim that sets storageClassName to standard-rwo uses that StorageClass's provisioner and parameters to create a PersistentVolume. Inspect available classes with kubectl get sc. If the field is omitted, Kubernetes uses the default StorageClass. section 10.2.5 section 10.4.3
$ kubectl get sc NAME PROVISIONER RECLAIMPOLICY enterprise-multishare-rwx filestore.csi.storage.gke.io Delete enterprise-rwx filestore.csi.storage.gke.io Delete premium-rwo pd.csi.storage.gke.io Delete premium-rwx filestore.csi.storage.gke.io Delete standard kubernetes.io/gce-pd Delete standard-rwo (default) pd.csi.storage.gke.io Delete standard-rwx filestore.csi.storage.gke.io Delete zonal-rwx filestore.csi.storage.gke.io Delete
Compare available StorageClasses, their provisioners, and the class marked as default. section 10.2.5
Keep these operational distinctions in mind:
- Changing storageClassName is not supported after PersistentVolumeClaim creation; switching classes requires creating a new claim. section 10.4.1
- The selected StorageClass also determines whether the bound volume can be expanded; existing claims can be enlarged but not reduced. section 10.4.1
- A StorageClass may delay provisioning until a pod first references the claim when it uses WaitForFirstConsumer. section 10.2.5
