-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templated Share Subdirectory #502
Comments
I think there is a way to implement this in smb csi driver for the first two, we should set |
Is there any information that is inferred from the final path name that is used in deletion that would need to be stored if the PVC is deleted, or is that information contained in the delete event? |
@MiddleMan5 the final subDir should be part of volumeid, so when deletion happen, the driver would know which subDir should be deleted. following are the testing logs, volume id format is like
|
PR #503 works with
|
Is your feature request related to a problem?/Why is this needed
We have a number of SMB NAS systems that we use as cluster-wide, general purpose storage, but provisioning sub-directories for each application is time-consuming and error prone and requires a human admin to configure.
As of now, we have to define a csi-smb-provisioned StorageClass per application deployment just to reliably control the directory that an application stores it's data in which again requires another additional cluster-admin step.
Describe the solution you'd like in detail
Ideally, a StorageClass could define a "subDir" template string that allows the admin to control how a new PVC is allocated a SMB share.
Given the above as an example of suggested syntax, The following additional use cases should be taken into consideration:
A unique share name per pvc:
Given:
subDir: "smb-auto-${pvc.metadata.name}"
Result:
//mynas.my.domain/storage/root/smb-auto-pvc-95f1d979-9cb2-4a84-90ed-5d25cebeccc4
Namespace-specific shared storage:
Given:
subDir: "smb-auto-${pvc.metadata.namespace}"
Result:
//mynas.my.domain/storage/root/smb-auto-production
A shared storage share that multiple pods of the same deployment share
Given:
subDir: "smb-auto-${pvc.annotations['app.kubernetes.io/instance']}"
Result:
//mynas.my.domain/storage/root/smb-auto-nginx-frontend
Describe alternatives you've considered
This feature request appears to be related to the discussion under issue #428
Additional context
Kubernetes 1.23
The text was updated successfully, but these errors were encountered: