From f1848cdd3409453dc47e9989acda56cb5d48913b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Va=C5=A1ek?= Date: Fri, 23 Jul 2021 07:11:15 +0200 Subject: [PATCH 1/3] [manila-csi-plugin] Add options for passing mount opts to cephfs-csi (#1605) * 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 * pass cephfs-kernelMountOptions and cephfs-fuseMountOptions to cephfs-csi * updated docs with new volume context opts --- docs/manila-csi-plugin/using-manila-csi-plugin.md | 4 ++++ pkg/csi/manila/options/shareoptions.go | 12 ++++++++---- pkg/csi/manila/shareadapters/cephfs.go | 14 ++++++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) 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)._ 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 ( 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 2155ee9bc6e9376459a971672d936dd17678a022 Mon Sep 17 00:00:00 2001 From: Anusha Ramineni Date: Fri, 23 Jul 2021 15:25:16 +0530 Subject: [PATCH 2/3] [cinder-csi-plugin] Remove redundant imagePullPolicy (#1602) --- charts/cinder-csi-plugin/Chart.yaml | 2 +- charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/cinder-csi-plugin/Chart.yaml b/charts/cinder-csi-plugin/Chart.yaml index 0a9999150e..45d1596525 100644 --- a/charts/cinder-csi-plugin/Chart.yaml +++ b/charts/cinder-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: latest description: Cinder CSI Chart for OpenStack name: openstack-cinder-csi -version: 1.4.4 +version: 1.4.5 home: https://github.com/kubernetes/cloud-provider-openstack icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png maintainers: diff --git a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml index 1d8b95386a..f9d6b959c1 100644 --- a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml +++ b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml @@ -37,7 +37,6 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - imagePullPolicy: "IfNotPresent" volumeMounts: - name: socket-dir mountPath: /csi @@ -83,7 +82,6 @@ spec: initialDelaySeconds: {{ .Values.csi.livenessprobe.initialDelaySeconds }} timeoutSeconds: {{ .Values.csi.livenessprobe.timeoutSeconds }} periodSeconds: {{ .Values.csi.livenessprobe.periodSeconds }} - imagePullPolicy: "IfNotPresent" volumeMounts: - name: socket-dir mountPath: /csi From 02cddd317e4d79c9da3d536159f913f0c5a9e246 Mon Sep 17 00:00:00 2001 From: Anusha Ramineni Date: Wed, 28 Jul 2021 10:23:34 +0530 Subject: [PATCH 3/3] [cinder-csi-plugin] Fix duplicate keys of tolerations (#1609) --- charts/cinder-csi-plugin/Chart.yaml | 2 +- charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml | 2 -- charts/cinder-csi-plugin/values.yaml | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/charts/cinder-csi-plugin/Chart.yaml b/charts/cinder-csi-plugin/Chart.yaml index 45d1596525..9a7da5f359 100644 --- a/charts/cinder-csi-plugin/Chart.yaml +++ b/charts/cinder-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: latest description: Cinder CSI Chart for OpenStack name: openstack-cinder-csi -version: 1.4.5 +version: 1.4.6 home: https://github.com/kubernetes/cloud-provider-openstack icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png maintainers: diff --git a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml index f9d6b959c1..2845239847 100644 --- a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml +++ b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml @@ -13,8 +13,6 @@ spec: labels: {{- include "cinder-csi.nodeplugin.labels" . | nindent 8 }} spec: - tolerations: - - operator: Exists serviceAccount: csi-cinder-node-sa hostNetwork: true containers: diff --git a/charts/cinder-csi-plugin/values.yaml b/charts/cinder-csi-plugin/values.yaml index 464cd6d4e7..ed97819d65 100644 --- a/charts/cinder-csi-plugin/values.yaml +++ b/charts/cinder-csi-plugin/values.yaml @@ -63,7 +63,8 @@ csi: nodePlugin: affinity: {} nodeSelector: {} - tolerations: [] + tolerations: + - operator: Exists controllerPlugin: affinity: {} nodeSelector: {}