rancher / local-path-provisioner

Dynamically provisioning persistent local storage with Kubernetes
Apache License 2.0
2.07k stars 439 forks source link

feature: add support to set folderName on PVC #384

Closed vvanouytsel closed 2 weeks ago

vvanouytsel commented 5 months ago

Whenever a PV is dynamically created, a directory is generated with the following name $persistentVolumeName_$persistentVolumeClaimNamespace_$persistentVolumeClaimName.

It would be helpful if we can decide what the directory name of the generated directory would be up front. This could be done by setting an annotation on the persistent volume claim.

annotations:
  folderName: fooBar

This logic is included in the following PR: https://github.com/rancher/local-path-provisioner/pull/372

XtraLarge commented 5 months ago

It would be great to consider also implement it in the automatic provisioner. Smething like use the namespace of the pvc so the PVs will automatically sorted in folders named by the namespace.

In my scenario I have four k3s-nodes in a lxc container runnig on a proxmox server. They all share one datadir where local-path autoprovision the pvs. This datadir is quit confusing because of the flat use of the volid as the name in that directory.

senpro-ingwersenk commented 2 months ago

Seconding this.

I finished bootstrapping a k3s cluster for a client and getting to the storage paths is a bit confusing. Not impossible, but it very much is not a whole lot of fun. For my own deployment at home, I plan to use the shared filesystem together with a permanent rclone mount, which I access from many locations. Being able to "predict" the name would be very helpful here when I need to dig into log files or the like.

Thanks!

lizhifengones commented 2 months ago

To reconsider this point, for example, we can mount different disks for different PVs to achieve IO isolation But for my needs I don't need full customization, I just need subDirPath

lizhifengones commented 2 months ago

@derekbit PTAL Are we still accepting any features?

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 weeks ago

This issue was closed because it has been stalled for 5 days with no activity.