kubevirt / csi-driver

KubeVirt CSI driver
Other
38 stars 26 forks source link

Add WaitForFirstConsumer support #116

Open kvaps opened 1 month ago

kvaps commented 1 month ago

Is your feature request related to a problem? Please describe:

If you're using storageclass with volumeBindingMode: WaitForFirstConsumer it is not binding volumes and waiting for first usage of the volume:

# k describe pvc -n tenant-k8suser16735  pvc-0db10b63-afb0-49c1-80aa-698761fe5805
Name:          pvc-0db10b63-afb0-49c1-80aa-698761fe5805
Namespace:     tenant-k8suser16735
StorageClass:  replicated
Status:        Pending
Volume:
Labels:        app=containerized-data-importer
               app.kubernetes.io/component=storage
               app.kubernetes.io/managed-by=cdi-controller
               csi-driver/cluster=test
Annotations:   cdi.kubevirt.io/storage.contentType: kubevirt
               cdi.kubevirt.io/storage.deleteAfterCompletion: false
               cdi.kubevirt.io/storage.pod.restarts: 0
               cdi.kubevirt.io/storage.preallocation.requested: false
               cdi.kubevirt.io/storage.usePopulator: true
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Block
DataSource:
  APIGroup:  cdi.kubevirt.io
  Kind:      VolumeImportSource
  Name:      volume-import-source-9971aa28-269b-4baa-89e8-bc651792e7c5
Used By:     <none>
Events:
  Type    Reason                Age                    From                         Message
  ----    ------                ----                   ----                         -------
  Normal  WaitForFirstConsumer  2m16s (x262 over 67m)  persistentvolume-controller  waiting for first consumer to be created before binding
awels commented 1 month ago

Yes this is a known issue, we have to propagate the WFFC to the tenant storage class as well. I had an open issue explaining some of the issues, just haven't gotten around to it. https://github.com/kubevirt/csi-driver/issues/66