9.4. Setting the default storage class
A default storage class automatically provisions persistent volumes when you create persistent volume claims (PVCs) without specifying a storage class.
This simplifies storage management by removing the need for users to select a storage class for each claim. To designate a storage class as the cluster-wide default, add an annotation to the storage class metadata.
Prerequisites
- Logged in to a running OpenShift Container Platform cluster with administrator privileges.
Procedure
For your required storage class, set the
metadata.annotations.storageclass.kubernetes.io/is-default-classfield totrueas in the following example:Example storage class YAML file
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: storageclass.kubernetes.io/is-default-class: "true" ...참고The beta annotation
storageclass.beta.kubernetes.io/is-default-classis still working; however, it will be removed in a future release.Optional: Create a storage class description in the
metadata.annotations.kubernetes.io/descriptionfield as in the following example:Example storage class YAML file
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: kubernetes.io/description: My Storage Class Description ...