ceph / ceph-csi

CSI driver for Ceph
Apache License 2.0
1.27k stars 536 forks source link

nfs: allow users to specify NFS export name #4414

Open yician1000 opened 8 months ago

yician1000 commented 8 months ago

Describe the feature you'd like to have

Currently, NFS export name is generated by ComposeCSIID() and the generated name is a long alphanumeric string. We hope we can specify a meaningful name for a NFS export.

What is the value to the end user? (why is it a priority?)

No priority, but I think it's good to have. Users can specify a simple and meaningful NFS export name as they want and it would be more convenient for users to manage NFS exports.

How will we know we have a good solution? (acceptance criteria)

I know that we can pass parameters in StorageClass to CSI drivers. However, specifying NFS export name in StorageClass seems not a good idea. Not sure if it's possible to pass PVC name to CSI driver?

nixpanic commented 7 months ago

That can probably be done, but a name needs to be unique enough so that no collisions can happen. It is possible with the Kubernets CSI components to pass additional metadata about a PV/PVC in the CreateVolume request.

If the Ceph cluster is only used for one Kubernetes cluster, we could setup the name like /namespace/pvc. But if there are multiple Kubernetes clusters using the Ceph cluster, something like the cluster ID needs to be included too (or some unique prefix as parameter in the StorageClass).

nixpanic commented 7 months ago

The csi-provisioner container that gets deployed supports the --extra-create-metadata=true option, setting this proivides (among others):

Madhu-1 commented 7 months ago

@nixpanic do we have any length limitation on the exporter we create and what if same name/namespace is used in the different cluster you mentioned and its an external ceph cluster?

nixpanic commented 7 months ago

@nixpanic do we have any length limitation on the exporter we create and what if same name/namespace is used in the different cluster you mentioned and its an external ceph cluster?

NFS has standard filename/path limitations. The limitations of the object names in Kubernetes and the CSI spec are more strict.

If there are two Kubernetes clusters using the same Ceph cluster, and there exists a namespace/pvc combination in both Kubernetes cluster, the behaviour would be undefined. Users should not enable this "friendly name" feature in that case.

yician1000 commented 7 months ago

@nixpanic
Thanks for your reply. I think setting up the name like /namespace/pvc by using --extra-create-metadata=true option is a good solution.

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

yician1000 commented 6 months ago

friendly ping

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

yician1000 commented 5 months ago

ping

nixpanic commented 5 months ago

Contributions for this feature are very welcome!