ceph-csi icon indicating copy to clipboard operation
ceph-csi copied to clipboard

nfs: allow users to specify NFS export name

Open yician1000 opened this issue 1 year ago • 11 comments

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?

yician1000 avatar Feb 02 '24 08:02 yician1000

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 avatar Feb 08 '24 10:02 nixpanic

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

  • csi.storage.k8s.io/pvc/namespace
  • csi.storage.k8s.io/pvc/name

nixpanic avatar Feb 08 '24 15:02 nixpanic

@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?

Madhu-1 avatar Feb 08 '24 16:02 Madhu-1

@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.

nixpanic avatar Feb 09 '24 13:02 nixpanic

@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.

yician1000 avatar Feb 15 '24 04:02 yician1000

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.

github-actions[bot] avatar Mar 16 '24 21:03 github-actions[bot]

friendly ping

yician1000 avatar Mar 18 '24 02:03 yician1000

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.

github-actions[bot] avatar Apr 17 '24 21:04 github-actions[bot]

ping

yician1000 avatar Apr 19 '24 01:04 yician1000

Contributions for this feature are very welcome!

nixpanic avatar Apr 19 '24 13:04 nixpanic