Dong Ma | 0a05b5c | 2024-11-24 13:27:29 +0800 | [diff] [blame] | 1 | diff --git a/cinder/templates/configmap-etc.yaml b/cinder/templates/configmap-etc.yaml |
| 2 | index 1a20ea84..97bfe0f7 100644 |
| 3 | --- a/cinder/templates/configmap-etc.yaml |
| 4 | +++ b/cinder/templates/configmap-etc.yaml |
| 5 | @@ -165,6 +165,14 @@ limitations under the License. |
| 6 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 7 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 8 | {{- end -}} |
| 9 | + |
| 10 | +{{- range $key, $backend := .Values.conf.backends }} |
| 11 | +{{- if and $backend.nfs_shares_config (not $backend.nfs_shares_config_content) }} |
| 12 | +{{- $nfs_shares_config_content := $backend.nfs_shares_config }} |
| 13 | +{{- $_ := set $backend "nfs_shares_config_content" $nfs_shares_config_content -}} |
| 14 | +{{- $_ := set $backend "nfs_shares_config" (printf "/etc/cinder/nfs/%s" $key) -}} |
| 15 | +{{- end -}} |
| 16 | +{{- end -}} |
| 17 | --- |
| 18 | apiVersion: v1 |
| 19 | kind: Secret |
| 20 | @@ -198,3 +206,13 @@ data: |
| 21 | external-ceph.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.ceph_client.external_ceph.conf | b64enc }} |
| 22 | {{- end }} |
| 23 | {{- end }} |
| 24 | +{{- range $key, $backend := .Values.conf.backends }} |
| 25 | +{{- if $backend.nfs_shares_config }} |
| 26 | + nfs-{{ $key }}: | |
| 27 | + {{- if kindIs "string" $backend.nfs_shares_config_content }} |
| 28 | + {{ $backend.nfs_shares_config_content | b64enc }} |
| 29 | + {{- else if kindIs "slice" $backend.nfs_shares_config_content }} |
| 30 | + {{ $backend.nfs_shares_config_content | join "\n" | b64enc }} |
| 31 | + {{- end }} |
| 32 | +{{- end }} |
| 33 | +{{- end }} |
| 34 | diff --git a/cinder/templates/deployment-volume.yaml b/cinder/templates/deployment-volume.yaml |
| 35 | index 93625536..a21c13ef 100644 |
| 36 | --- a/cinder/templates/deployment-volume.yaml |
| 37 | +++ b/cinder/templates/deployment-volume.yaml |
| 38 | @@ -242,6 +242,14 @@ spec: |
| 39 | readOnly: true |
| 40 | {{- end }} |
| 41 | {{- end }} |
| 42 | + {{- range $key, $backend := .Values.conf.backends }} |
| 43 | + {{- if $backend.nfs_shares_config }} |
| 44 | + - name: cinder-etc |
| 45 | + mountPath: /etc/cinder/nfs/{{ $key }} |
| 46 | + subPath: nfs-{{ $key }} |
| 47 | + readOnly: true |
| 48 | + {{- end }} |
| 49 | + {{- end }} |
| 50 | {{- if .Values.conf.enable_iscsi }} |
| 51 | - name: host-rootfs |
| 52 | mountPath: /mnt/host-rootfs |