Created attachment 1668958 [details]
Description of problem:
In an IPI deployment of OCP4.3 with the 'standard' storageclass set as default, PVCs are not bound, if their definition contains a storageclass attribute set to an empty string.
This problem also hinders the OCS deployment via Operator, because the operator creates PVCs with a storageclass set to ''.
Steps to Reproduce:
1. create simple PVC yaml file
2. use oc create
3. PVC does not bind to default storage class
PVC fails to bind
PVC gets bound to the default storageclass (in this cluster 'standard')
[ansible@ocp-bastion-01 gcp]$ oc get sc
NAME PROVISIONER AGE
ocs-storagecluster-ceph-rbd openshift-storage.rbd.csi.ceph.com 28h
ocs-storagecluster-cephfs openshift-storage.cephfs.csi.ceph.com 28h
openshift-storage.noobaa.io openshift-storage.noobaa.io/obc 27h
standard (default) kubernetes.io/gce-pd 29h
[ansible@ocp-bastion-01 gcp]$ oc describe pvc hr-test
Mounted By: <none>
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailedBinding 3m5s (x104 over 28m) persistentvolume-controller no persistent volumes available for this claim and no storage class is set
> PVCs are not bound, if their definition contains a storageclass attribute set to an empty string.
This is expected behavior. Set pvc.spec.storageClassname=nil to get the default storage class. Use pvc.spec.storageClassname="" to bind to manually provisioned PVs with storageClassName="". It is actually the only way to bind to "class-less" PVs, so we need to keep this behavior. You can see message "no persistent volumes available for this claim and no storage class is set".
> the operator creates PVCs with a storageclass set to ''
What operator is it? It must be fixed.
OK, thanks for your quick answer. The described example was simply for quick reproduction
>>What operator is it? It must be fixed.
The Openshift Container Storage Operator on GCP (latest version 4.2) is setting its storageclasses for automatically created PVSs (e.g. ceph-mon-a) to ''. Thus the operator deployment fails if you do not change the PVCs manually to use the default storage class.