diff --git a/charts/manila-csi-plugin/Chart.yaml b/charts/manila-csi-plugin/Chart.yaml index 03499bf7e9..a9a175033a 100644 --- a/charts/manila-csi-plugin/Chart.yaml +++ b/charts/manila-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v1.36.0 description: Manila CSI Chart for OpenStack name: openstack-manila-csi -version: 2.36.1 +version: 2.36.2 home: http://github.com/kubernetes/cloud-provider-openstack icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png maintainers: diff --git a/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml b/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml index b820b8301a..322d22c2fe 100644 --- a/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml +++ b/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml @@ -62,7 +62,10 @@ spec: --drivername=$(DRIVER_NAME) --share-protocol-selector=$(MANILA_SHARE_PROTO) --fwdendpoint=$(FWD_CSI_ENDPOINT) - --cluster-id=$(CLUSTER_NAME)' + --cluster-id="{{ $.Values.csimanila.clusterID }}" + {{- if $.Values.csimanila.searchOrder }} + --search-order="{{ $.Values.csimanila.searchOrder }}" + {{- end }}' ] env: - name: DRIVER_NAME @@ -91,6 +94,9 @@ spec: mountPath: /runtimeconfig readOnly: true {{- end }} + - name: configdrive-dev + mountPath: /dev + mountPropagation: "HostToContainer" {{- with $.Values.nodeplugin.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} @@ -117,6 +123,10 @@ spec: name: manila-csi-runtimeconf-cm {{- end }} {{- end }} + - name: configdrive-dev + hostPath: + path: /dev + type: Directory {{- with .Values.nodeplugin.volumes }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/manila-csi-plugin/values.yaml b/charts/manila-csi-plugin/values.yaml index 8a10521bbe..ddef3acbc4 100644 --- a/charts/manila-csi-plugin/values.yaml +++ b/charts/manila-csi-plugin/values.yaml @@ -48,6 +48,9 @@ csimanila: pullPolicy: IfNotPresent tag: # defaults to .Chart.AppVersion + # Set the search order in which the driver retrieves metadata relating to the instance (s) in which it runs + searchOrder: "" + # DeamonSet deployment nodeplugin: # Component name diff --git a/cmd/manila-csi-plugin/main.go b/cmd/manila-csi-plugin/main.go index f1505b3f98..1114685f95 100644 --- a/cmd/manila-csi-plugin/main.go +++ b/cmd/manila-csi-plugin/main.go @@ -52,6 +52,7 @@ var ( userAgentData []string provideControllerService bool provideNodeService bool + searchOrder string ) func validateShareProtocolSelector(v string) error { @@ -104,8 +105,13 @@ func main() { } if provideNodeService { + err = metadata.CheckMetadataSearchOrder(searchOrder) + if err != nil { + klog.Fatalf("Invalid search-order: %v", err) + } + // Initialize metadata - metadata := metadata.GetMetadataProvider("") + metadata := metadata.GetMetadataProvider(searchOrder) err = d.SetupNodeService(metadata) if err != nil { @@ -158,6 +164,7 @@ func main() { cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)") cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)") + cmd.PersistentFlags().StringVar(&searchOrder, "search-order", "configDrive,metadataService", "The search order in which the driver retrieves metadata relating to the instance (s) in which it runs") code := cli.Run(cmd) os.Exit(code) diff --git a/docs/manila-csi-plugin/using-manila-csi-plugin.md b/docs/manila-csi-plugin/using-manila-csi-plugin.md index 29be4ac5b6..e697cd0291 100644 --- a/docs/manila-csi-plugin/using-manila-csi-plugin.md +++ b/docs/manila-csi-plugin/using-manila-csi-plugin.md @@ -44,6 +44,7 @@ Option | Default value | Description `--provide-controller-service` | `true` | If set to true then the CSI driver does provide the controller service. `--provide-node-service` | `true` | If set to true then the CSI driver does provide the node service. `--pvc-annotations` | `false` | If set to true then the CSI driver will use PVC annotations as an additional information when creating shares. See [Supported PVC annotations](#supported-pvc-annotations) for more info. +`--search-order` | `configDrive,metadataService` | The search order in which the driver retrieves metadata relating to the instance in which it runs. Only effective when `--provide-node-service=true`. ### Controller Service volume parameters diff --git a/manifests/manila-csi-plugin/csi-nodeplugin.yaml b/manifests/manila-csi-plugin/csi-nodeplugin.yaml index 4a2e9302a8..ed49a4c025 100644 --- a/manifests/manila-csi-plugin/csi-nodeplugin.yaml +++ b/manifests/manila-csi-plugin/csi-nodeplugin.yaml @@ -80,6 +80,9 @@ spec: mountPath: /var/lib/kubelet/plugins/manila.csi.openstack.org - name: fwd-plugin-dir mountPath: /var/lib/kubelet/plugins/FWD-NODEPLUGIN + - name: configdrive-dev + mountPath: /dev + mountPropagation: "HostToContainer" volumes: - name: registration-dir hostPath: @@ -93,4 +96,7 @@ spec: hostPath: path: /var/lib/kubelet/plugins/FWD-NODEPLUGIN type: DirectoryOrCreate - + - name: configdrive-dev + hostPath: + path: /dev + type: Directory