local-path-provisioner icon indicating copy to clipboard operation
local-path-provisioner copied to clipboard

feature: add support to set folderName on PVC

Open vvanouytsel opened this issue 1 year ago • 4 comments

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

vvanouytsel avatar Feb 06 '24 08:02 vvanouytsel

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.

XtraLarge avatar Feb 06 '24 10:02 XtraLarge

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!

senpro-ingwersenk avatar Apr 12 '24 08:04 senpro-ingwersenk

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 avatar Apr 18 '24 08:04 lizhifengones

@derekbit PTAL Are we still accepting any features?

lizhifengones avatar Apr 18 '24 08:04 lizhifengones

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] avatar Jun 18 '24 02:06 github-actions[bot]

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

github-actions[bot] avatar Jun 23 '24 02:06 github-actions[bot]