csi-addons / kubernetes-csi-addons

CSI-Addons implementation and APIs for Kubernetes
Apache License 2.0
17 stars 37 forks source link

Auto reclaim storage based on the storageclass/namespace #557

Open Madhu-1 opened 5 months ago

Madhu-1 commented 5 months ago

The current way of annotating the PVC, namespace is not so useful because the customer needs to annotate the resources and doesn't provide any option for the admin if someone wants to auto reclaim the space, Provide an option set at the csi-addon controller that exposes some configurations to say auto reclaim space for the PV created by this driver.

Example: add support to , separate driver names which can auto reclaim to https://github.com/csi-addons/kubernetes-csi-addons/blob/main/deploy/controller/csi-addons-config.yaml or some other way.

The above is helpful for the PV key rotation as well.

Admins deploying the operator need not worry about security or storage if it is unused and unannotated.

nixpanic commented 5 months ago

@Madhu-1: Instead of an option per driver, it would probably make more sense to have an option per StorageClass? That way it would be possible for admins to enable/disable auto-reclaim a little more granular.

Madhu-1 commented 5 months ago

@Madhu-1: Instead of an option per driver, it would probably make more sense to have an option per StorageClass? That way it would be possible for admins to enable/disable auto-reclaim a little more granular.

Yes that is also one option and we need to add EnqueueRequestsFromMapFunc in our PVC controller to watch for storageclass and namespace objects and reconcile all the PVC's or something like that which will help us to reconcile all the PVC's if the annotation is added/deleted/updated on the storageclass/namespace