backube / snapscheduler

Scheduled snapshots for Kubernetes persistent volumes
https://backube.github.io/snapscheduler/
GNU Affero General Public License v3.0
262 stars 26 forks source link

Add storageclass selector for schedule #676

Open Hechamon opened 2 months ago

Hechamon commented 2 months ago

Describe the feature you'd like to have. Currently it is only possible to add a label based claims selector. I would like to be able to select pvcs based on the storage class.

What is the value to the end user? (why is it a priority?) My usecase is the following: I have two storage classes that are based on the same csi driver. Both of these need different storagesnapshot classes for the snapshots. I cannot leave the snapshot class blank, because kubernetes will fail to select which snapshot class to use. I also cannot set a default snapshot class in the cluster, because that will fail for half my snapshots.

As a workaround, I can add a label to the pvc, to mark which storage class they are using. However this is likely to be forgotten by my engineers or impossible for external helm charts for example. That's why it would be great to be able to create a separate schedule which the proper snapshot class based on which storage class the volume is.

How will we know we have a good solution? (acceptance criteria) I can create a schedule that selects pvcs based on their storage class.

Additional context