From 1241a2b1c2049e9ecf7249b6c16de25586eb1581 Mon Sep 17 00:00:00 2001 From: Robert Vasek Date: Wed, 21 Jul 2021 13:53:18 +0200 Subject: [PATCH 1/3] added cephfs-csi mount opts to volume context This commit adds two new options specific to cephfs-csi to ControllerVolumeContext and NodeVolumeContext: * cephfs-kernelMountOptions, * cephfs-fuseMountOptions --- pkg/csi/manila/options/shareoptions.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/csi/manila/options/shareoptions.go b/pkg/csi/manila/options/shareoptions.go index 4d744d9422..ceab39a8c1 100644 --- a/pkg/csi/manila/options/shareoptions.go +++ b/pkg/csi/manila/options/shareoptions.go @@ -29,9 +29,11 @@ type ControllerVolumeContext struct { // Adapter options - CephfsMounter string `name:"cephfs-mounter" value:"default:fuse" matches:"^kernel|fuse$"` - CephfsClientID string `name:"cephfs-clientID" value:"optional"` - NFSShareClient string `name:"nfs-shareClient" value:"default:0.0.0.0/0"` + CephfsMounter string `name:"cephfs-mounter" value:"default:fuse" matches:"^kernel|fuse$"` + CephfsClientID string `name:"cephfs-clientID" value:"optional"` + CephfsKernelMountOptions string `name:"cephfs-kernelMountOptions" value:"optional"` + CephfsFuseMountOptions string `name:"cephfs-fuseMountOptions" value:"optional"` + NFSShareClient string `name:"nfs-shareClient" value:"default:0.0.0.0/0"` } type NodeVolumeContext struct { @@ -41,7 +43,9 @@ type NodeVolumeContext struct { // Adapter options - CephfsMounter string `name:"cephfs-mounter" value:"default:fuse" matches:"^kernel|fuse$"` + CephfsMounter string `name:"cephfs-mounter" value:"default:fuse" matches:"^kernel|fuse$"` + CephfsKernelMountOptions string `name:"cephfs-kernelMountOptions" value:"optional"` + CephfsFuseMountOptions string `name:"cephfs-fuseMountOptions" value:"optional"` } var ( From a07b4f5299d8a3e37e874d246d295dfa1b6b9b8b Mon Sep 17 00:00:00 2001 From: Robert Vasek Date: Wed, 21 Jul 2021 13:57:21 +0200 Subject: [PATCH 2/3] pass cephfs-kernelMountOptions and cephfs-fuseMountOptions to cephfs-csi --- pkg/csi/manila/shareadapters/cephfs.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/csi/manila/shareadapters/cephfs.go b/pkg/csi/manila/shareadapters/cephfs.go index 5ff1bafec0..7ecd55181f 100644 --- a/pkg/csi/manila/shareadapters/cephfs.go +++ b/pkg/csi/manila/shareadapters/cephfs.go @@ -117,12 +117,22 @@ func (Cephfs) BuildVolumeContext(args *VolumeContextArgs) (volumeContext map[str monitors, rootPath, err := splitExportLocationPath(args.Locations[chosenExportLocationIdx].Path) - return map[string]string{ + volCtx := map[string]string{ "monitors": monitors, "rootPath": rootPath, "mounter": args.Options.CephfsMounter, "provisionVolume": "false", - }, err + } + + if args.Options.CephfsKernelMountOptions != "" { + volCtx["kernelMountOptions"] = args.Options.CephfsKernelMountOptions + } + + if args.Options.CephfsFuseMountOptions != "" { + volCtx["fuseMountOptions"] = args.Options.CephfsFuseMountOptions + } + + return volCtx, err } func (Cephfs) BuildNodeStageSecret(args *SecretArgs) (secret map[string]string, err error) { From 9f26bc4c4643df82f1a2c32b2d56e92e1928e920 Mon Sep 17 00:00:00 2001 From: Robert Vasek Date: Wed, 21 Jul 2021 14:02:07 +0200 Subject: [PATCH 3/3] updated docs with new volume context opts --- docs/manila-csi-plugin/using-manila-csi-plugin.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/manila-csi-plugin/using-manila-csi-plugin.md b/docs/manila-csi-plugin/using-manila-csi-plugin.md index 4fa9b98929..f6914e6050 100644 --- a/docs/manila-csi-plugin/using-manila-csi-plugin.md +++ b/docs/manila-csi-plugin/using-manila-csi-plugin.md @@ -50,6 +50,8 @@ Parameter | Required | Description `availability` | _no_ | Manila availability zone of the provisioned share. If none is provided, the default Manila zone will be used. Note that this parameter is opaque to the CO and does not influence placement of workloads that will consume this share, meaning they may be scheduled onto any node of the cluster. If the specified Manila AZ is not equally accessible from all compute nodes of the cluster, use [Topology-aware dynamic provisioning](#topology-aware-dynamic-provisioning). `appendShareMetadata` | _no_ | Append user-defined metadata to the provisioned share. If not empty, this field must be a string with a valid JSON object. The object must consist of key-value pairs of type string. Example: `"{..., \"key\": \"value\"}"`. `cephfs-mounter` | _no_ | Relevant for CephFS Manila shares. Specifies which mounting method to use with the CSI CephFS driver. Available options are `kernel` and `fuse`, defaults to `fuse`. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. +`cephfs-kernelMountOptions` | _no_ | Relevant for CephFS Manila shares. Specifies mount options for CephFS kernel client. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. +`cephfs-fuseMountOptions` | _no_ | Relevant for CephFS Manila shares. Specifies mount options for CephFS FUSE client. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. `cephfs-clientID` | _no_ | Relevant for CephFS Manila shares. Specifies the cephx client ID when creating an access rule for the provisioned share. The same cephx client ID may be shared with multiple Manila shares. If no value is provided, client ID for the provisioned Manila share will be set to some unique value (PersistentVolume name). `nfs-shareClient` | _no_ | Relevant for NFS Manila shares. Specifies what address has access to the NFS share. Defaults to `0.0.0.0/0`, i.e. anyone. @@ -63,6 +65,8 @@ Parameter | Required | Description `shareName` | if `shareID` is not given | The name of the share `shareAccessID` | _yes_ | The UUID of the access rule for the share `cephfs-mounter` | _no_ | Relevant for CephFS Manila shares. Specifies which mounting method to use with the CSI CephFS driver. Available options are `kernel` and `fuse`, defaults to `fuse`. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. +`cephfs-kernelMountOptions` | _no_ | Relevant for CephFS Manila shares. Specifies mount options for CephFS kernel client. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. +`cephfs-fuseMountOptions` | _no_ | Relevant for CephFS Manila shares. Specifies mount options for CephFS FUSE client. See [CSI CephFS docs](https://github.com/ceph/ceph-csi/blob/csi-v1.0/docs/deploy-cephfs.md#configuration) for further information. _Note that the Node Plugin of CSI Manila doesn't care about the origin of a share. As long as the share protocol is supported, CSI Manila is able to consume dynamically provisioned as well as pre-provisioned shares (e.g. shares created manually)._