Skip to content

Option to define a DataVolume-specific scratchSpaceStorageClass #3848

@lennartmoeller

Description

@lennartmoeller

We installed Kubevirt and CDI in a namespace called kubevirt.

We created a DataVolume in a separate namespace restricted-namespace that uses a namespace-specific storage class and has no permission to use the default storage class default:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: my-image-dv
spec:
  source:
    registry:
      url: docker://myrepo.azurecr.io/my/image:latest
  storage:
    accessModes:
      - ReadWriteMany
    storageClassName: namespace-specific-storage-class
    volumeMode: Filesystem
    resources:
      requests:
        storage: 7Gi

Now the pod importer-prime-4faba107-5228-4956-8378-cd9a34b89e98 creates two PVCs: prime-4faba107-5228-4956-8378-cd9a34b89e98 that uses the storage class namespace-specific-storage-class and prime-4faba107-5228-4956-8378-cd9a34b89e98-scratch that uses the default storage class. But as the namespace does not allow PVCs to use the default storage class, the importing process fails.

We can set the scratchSpaceStorageClass in the CDI CR globally (API reference), but as we have multiple restricted namespaces with their individual storage classes, this is not an option. So it would be great to have an option to set the scratchSpaceStorageClass for each DataVolume individually and override the global value. An alternative would be to have an option to always set the scratch PVC storage class to the one specified in the DataVolume.

Or is there a workaround we're missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    good-first-issueIdentifies an issue that has been specifically created or selected for first-time contributors.kind/enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions