From 76d7608ba69db8eaf913b975270eb4bee64491a7 Mon Sep 17 00:00:00 2001 From: pli Date: Fri, 7 Jun 2024 10:49:56 +0200 Subject: [PATCH] [cinder-csi-plugin] Add extraEnv support on cinder-csi-plugin and manila-csi-plugin helm charts (#2613) * Support extraEnv on the cinder-csi-plugin helm chart Signed-off-by: pli01 * Support extraEnv on the cinder-csi-plugin helm chart Signed-off-by: pli01 * Support extraEnv on manila-csi-plugin helm chart * typo --------- Signed-off-by: pli01 --- charts/cinder-csi-plugin/Chart.yaml | 2 +- .../templates/controllerplugin-deployment.yaml | 18 ++++++++++++++++++ .../templates/nodeplugin-daemonset.yaml | 10 ++++++++++ charts/cinder-csi-plugin/values.yaml | 7 +++++++ charts/manila-csi-plugin/Chart.yaml | 2 +- .../controllerplugin-statefulset.yaml | 12 ++++++++++++ .../templates/nodeplugin-daemonset.yaml | 6 ++++++ charts/manila-csi-plugin/values.yaml | 6 ++++++ 8 files changed, 61 insertions(+), 2 deletions(-) diff --git a/charts/cinder-csi-plugin/Chart.yaml b/charts/cinder-csi-plugin/Chart.yaml index 25c6668adf..9e87898fa3 100644 --- a/charts/cinder-csi-plugin/Chart.yaml +++ b/charts/cinder-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v1.30.0 description: Cinder CSI Chart for OpenStack name: openstack-cinder-csi -version: 2.30.0 +version: 2.30.1-alpha.1 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/controllerplugin-deployment.yaml b/charts/cinder-csi-plugin/templates/controllerplugin-deployment.yaml index 774623134d..542c179f5a 100644 --- a/charts/cinder-csi-plugin/templates/controllerplugin-deployment.yaml +++ b/charts/cinder-csi-plugin/templates/controllerplugin-deployment.yaml @@ -53,6 +53,9 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock + {{- if .Values.csi.attacher.extraEnv }} + {{- toYaml .Values.csi.attacher.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ @@ -78,6 +81,9 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock + {{- if .Values.csi.provisioner.extraEnv }} + {{- toYaml .Values.csi.provisioner.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ @@ -100,6 +106,9 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock + {{- if .Values.csi.snapshotter.extraEnv }} + {{- toYaml .Values.csi.snapshotter.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /var/lib/csi/sockets/pluginproxy/ name: socket-dir @@ -123,6 +132,9 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock + {{- if .Values.csi.resizer.extraEnv }} + {{- toYaml .Values.csi.resizer.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - name: socket-dir mountPath: /var/lib/csi/sockets/pluginproxy/ @@ -143,6 +155,9 @@ spec: env: - name: ADDRESS value: /var/lib/csi/sockets/pluginproxy/csi.sock + {{- if .Values.csi.livenessprobe.extraEnv }} + {{- toYaml .Values.csi.livenessprobe.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /var/lib/csi/sockets/pluginproxy/ name: socket-dir @@ -173,6 +188,9 @@ spec: value: /etc/kubernetes/{{ .Values.secret.filename }} - name: CLUSTER_NAME value: "{{ .Values.clusterID }}" + {{- if .Values.csi.plugin.extraEnv }} + {{- toYaml .Values.csi.plugin.extraEnv | nindent 12 }} + {{- end }} ports: - containerPort: 9808 name: healthz diff --git a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml index 7c046719cb..e55e8d69ea 100644 --- a/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml +++ b/charts/cinder-csi-plugin/templates/nodeplugin-daemonset.yaml @@ -49,6 +49,9 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + {{- if .Values.csi.nodeDriverRegistrar.extraEnv }} + {{- toYaml .Values.csi.nodeDriverRegistrar.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - name: socket-dir mountPath: /csi @@ -68,6 +71,10 @@ spec: {{- tpl . $ | trim | nindent 12 }} {{- end }} {{- end }} + env: + {{- if .Values.csi.livenessprobe.extraEnv }} + {{- toYaml .Values.csi.livenessprobe.extraEnv | nindent 12 }} + {{- end }} volumeMounts: - name: socket-dir mountPath: /csi @@ -95,6 +102,9 @@ spec: value: unix://csi/csi.sock - name: CLOUD_CONFIG value: /etc/kubernetes/{{ .Values.secret.filename }} + {{- if .Values.csi.plugin.extraEnv }} + {{- toYaml .Values.csi.plugin.extraEnv | nindent 12 }} + {{- end }} ports: - containerPort: 9808 name: healthz diff --git a/charts/cinder-csi-plugin/values.yaml b/charts/cinder-csi-plugin/values.yaml index 721f4a32a0..59bb34d51e 100644 --- a/charts/cinder-csi-plugin/values.yaml +++ b/charts/cinder-csi-plugin/values.yaml @@ -12,6 +12,7 @@ csi: pullPolicy: IfNotPresent resources: {} extraArgs: {} + extraEnv: [] provisioner: topology: "true" image: @@ -20,6 +21,7 @@ csi: pullPolicy: IfNotPresent resources: {} extraArgs: {} + extraEnv: [] snapshotter: image: repository: registry.k8s.io/sig-storage/csi-snapshotter @@ -27,6 +29,7 @@ csi: pullPolicy: IfNotPresent resources: {} extraArgs: {} + extraEnv: [] resizer: image: repository: registry.k8s.io/sig-storage/csi-resizer @@ -34,6 +37,7 @@ csi: pullPolicy: IfNotPresent resources: {} extraArgs: {} + extraEnv: [] livenessprobe: image: repository: registry.k8s.io/sig-storage/livenessprobe @@ -45,6 +49,7 @@ csi: periodSeconds: 60 resources: {} extraArgs: {} + extraEnv: [] nodeDriverRegistrar: image: repository: registry.k8s.io/sig-storage/csi-node-driver-registrar @@ -52,6 +57,7 @@ csi: pullPolicy: IfNotPresent resources: {} extraArgs: {} + extraEnv: [] plugin: image: repository: registry.k8s.io/provider-os/cinder-csi-plugin @@ -131,6 +137,7 @@ csi: podMonitor: enabled: false extraArgs: {} + extraEnv: [] # Log verbosity level. # See https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md diff --git a/charts/manila-csi-plugin/Chart.yaml b/charts/manila-csi-plugin/Chart.yaml index fd668767cf..a7cd93eec6 100644 --- a/charts/manila-csi-plugin/Chart.yaml +++ b/charts/manila-csi-plugin/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v1.30.0 description: Manila CSI Chart for OpenStack name: openstack-manila-csi -version: 2.30.0 +version: 2.30.1-alpha.1 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/controllerplugin-statefulset.yaml b/charts/manila-csi-plugin/templates/controllerplugin-statefulset.yaml index 1e84be5ca5..91a443336d 100644 --- a/charts/manila-csi-plugin/templates/controllerplugin-statefulset.yaml +++ b/charts/manila-csi-plugin/templates/controllerplugin-statefulset.yaml @@ -32,6 +32,9 @@ spec: env: - name: ADDRESS value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock" + {{- if $.Values.controllerplugin.provisioner.extraEnv }} + {{- toYaml $.Values.controllerplugin.provisioner.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.controllerplugin.provisioner.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir @@ -46,6 +49,9 @@ spec: env: - name: ADDRESS value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock" + {{- if $.Values.controllerplugin.snapshotter.extraEnv }} + {{- toYaml $.Values.controllerplugin.snapshotter.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.controllerplugin.snapshotter.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir @@ -61,6 +67,9 @@ spec: env: - name: ADDRESS value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock" + {{- if $.Values.controllerplugin.resizer.extraEnv }} + {{- toYaml $.Values.controllerplugin.resizer.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.controllerplugin.resizer.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir @@ -107,6 +116,9 @@ spec: value: "unix://{{ .fwdNodePluginEndpoint.dir }}/{{ .fwdNodePluginEndpoint.sockFile }}" - name: MANILA_SHARE_PROTO value: "{{ .protocolSelector }}" + {{- if $.Values.controllerplugin.nodeplugin.extraEnv }} + {{- toYaml $.Values.controllerplugin.nodeplugin.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.csimanila.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir diff --git a/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml b/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml index 597b472d0e..50647a62fc 100644 --- a/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml +++ b/charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml @@ -29,6 +29,9 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + {{- if $.Values.nodeplugin.registrar.extraEnv }} + {{- toYaml $.Values.nodeplugin.registrar.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.nodeplugin.registrar.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir @@ -74,6 +77,9 @@ spec: value: "unix://{{ .fwdNodePluginEndpoint.dir }}/{{ .fwdNodePluginEndpoint.sockFile }}" - name: MANILA_SHARE_PROTO value: "{{ .protocolSelector }}" + {{- if $.Values.nodeplugin.nodeplugin.extraEnv }} + {{- toYaml $.Values.nodeplugin.nodeplugin.extraEnv | nindent 12 }} + {{- end }} imagePullPolicy: {{ $.Values.csimanila.image.pullPolicy }} volumeMounts: - name: {{ .protocolSelector | lower }}-plugin-dir diff --git a/charts/manila-csi-plugin/values.yaml b/charts/manila-csi-plugin/values.yaml index 7f86ce9777..f8523e9c53 100644 --- a/charts/manila-csi-plugin/values.yaml +++ b/charts/manila-csi-plugin/values.yaml @@ -56,6 +56,7 @@ nodeplugin: # CSI Manila container compute resources constraints nodeplugin: resources: {} + extraEnv: [] # csi-node-driver-registrar registrar: image: @@ -63,6 +64,7 @@ nodeplugin: tag: v2.4.0 pullPolicy: IfNotPresent resources: {} + extraEnv: [] nodeSelector: {} tolerations: [] affinity: {} @@ -81,6 +83,7 @@ controllerplugin: # CSI Manila container compute resources constraints nodeplugin: resources: {} + extraEnv: [] # CSI external-provisioner container spec provisioner: image: @@ -88,6 +91,7 @@ controllerplugin: tag: v3.0.0 pullPolicy: IfNotPresent resources: {} + extraEnv: [] # Whether to pass --extra-create-metadata flag to csi-provisioner. extraCreateMetadata: false # CSI external-snapshotter container spec @@ -97,6 +101,7 @@ controllerplugin: tag: v5.0.1 pullPolicy: IfNotPresent resources: {} + extraEnv: [] # CSI external-resizer container spec resizer: image: @@ -104,6 +109,7 @@ controllerplugin: tag: v1.8.0 pullPolicy: IfNotPresent resources: {} + extraEnv: [] nodeSelector: {} tolerations: [] affinity: {}