blob: 97bfe0f7bfc94b8a960179b4e5a0a4b69eaf2ae8 [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001{{/*
2Licensed under the Apache License, Version 2.0 (the "License");
3you may not use this file except in compliance with the License.
4You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8Unless required by applicable law or agreed to in writing, software
9distributed under the License is distributed on an "AS IS" BASIS,
10WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11See the License for the specific language governing permissions and
12limitations under the License.
13*/}}
14
15{{- if .Values.manifests.configmap_etc }}
16{{- $envAll := . }}
17
18{{- if empty .Values.conf.cinder.keystone_authtoken.auth_uri -}}
19{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.cinder.keystone_authtoken "auth_uri" -}}
20{{- end -}}
21
22{{- if empty .Values.conf.cinder.keystone_authtoken.auth_url -}}
23{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.cinder.keystone_authtoken "auth_url" -}}
24{{- end -}}
25
26{{- if empty .Values.conf.cinder.keystone_authtoken.region_name -}}
27{{- $_ := set .Values.conf.cinder.keystone_authtoken "region_name" .Values.endpoints.identity.auth.cinder.region_name -}}
28{{- end -}}
29{{- if empty .Values.conf.cinder.keystone_authtoken.project_name -}}
30{{- $_ := set .Values.conf.cinder.keystone_authtoken "project_name" .Values.endpoints.identity.auth.cinder.project_name -}}
31{{- end -}}
32{{- if empty .Values.conf.cinder.keystone_authtoken.project_domain_name -}}
33{{- $_ := set .Values.conf.cinder.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.cinder.project_domain_name -}}
34{{- end -}}
35{{- if empty .Values.conf.cinder.keystone_authtoken.user_domain_name -}}
36{{- $_ := set .Values.conf.cinder.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.cinder.user_domain_name -}}
37{{- end -}}
38{{- if empty .Values.conf.cinder.keystone_authtoken.username -}}
39{{- $_ := set .Values.conf.cinder.keystone_authtoken "username" .Values.endpoints.identity.auth.cinder.username -}}
40{{- end -}}
41{{- if empty .Values.conf.cinder.keystone_authtoken.password -}}
42{{- $_ := set .Values.conf.cinder.keystone_authtoken "password" .Values.endpoints.identity.auth.cinder.password -}}
43{{- end -}}
44
45{{- if empty .Values.conf.cinder.keystone_authtoken.memcached_servers -}}
46{{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.cinder.keystone_authtoken "memcached_servers" -}}
47{{- end -}}
48{{- if empty .Values.conf.cinder.keystone_authtoken.memcache_secret_key -}}
49{{- $_ := set .Values.conf.cinder.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
50{{- end -}}
51
Mohammed Naser32137102023-02-23 17:26:32 +000052{{- if empty $envAll.Values.conf.cinder.nova.auth_url -}}
53{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set $envAll.Values.conf.cinder.nova "auth_url" -}}
54{{- end }}
55
56{{- if empty $envAll.Values.conf.cinder.nova.region_name -}}
57{{- $_ := set $envAll.Values.conf.cinder.nova "region_name" $envAll.Values.endpoints.identity.auth.cinder.region_name -}}
58{{- end -}}
59{{- if empty $envAll.Values.conf.cinder.nova.project_name -}}
60{{- $_ := set $envAll.Values.conf.cinder.nova "project_name" $envAll.Values.endpoints.identity.auth.cinder.project_name -}}
61{{- end -}}
62{{- if empty $envAll.Values.conf.cinder.nova.project_domain_name -}}
63{{- $_ := set $envAll.Values.conf.cinder.nova "project_domain_name" $envAll.Values.endpoints.identity.auth.cinder.project_domain_name -}}
64{{- end -}}
65{{- if empty $envAll.Values.conf.cinder.nova.user_domain_name -}}
66{{- $_ := set $envAll.Values.conf.cinder.nova "user_domain_name" $envAll.Values.endpoints.identity.auth.cinder.user_domain_name -}}
67{{- end -}}
68{{- if empty $envAll.Values.conf.cinder.nova.username -}}
69{{- $_ := set $envAll.Values.conf.cinder.nova "username" $envAll.Values.endpoints.identity.auth.cinder.username -}}
70{{- end -}}
71{{- if empty $envAll.Values.conf.cinder.nova.password -}}
72{{- $_ := set $envAll.Values.conf.cinder.nova "password" $envAll.Values.endpoints.identity.auth.cinder.password -}}
73{{- end -}}
74
Mohammed Naserf3f59a72023-01-15 21:02:04 -050075{{- if empty .Values.conf.cinder.database.connection -}}
76{{- $connection := tuple "oslo_db" "internal" "cinder" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
77{{- if .Values.manifests.certificates -}}
78{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.cinder.database "connection" -}}
79{{- else -}}
80{{- $_ := set .Values.conf.cinder.database "connection" $connection -}}
81{{- end -}}
82{{- end -}}
83
84{{- if empty .Values.conf.cinder.DEFAULT.transport_url -}}
85{{- $_ := tuple "oslo_messaging" "internal" "cinder" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.cinder.DEFAULT "transport_url" -}}
86{{- end -}}
87
88{{- if empty .Values.conf.cinder.DEFAULT.glance_api_servers -}}
89{{- $_ := tuple "image" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.cinder.DEFAULT "glance_api_servers" -}}
90{{- end -}}
91
92{{- if (contains "cinder.backup.drivers.swift" .Values.conf.cinder.DEFAULT.backup_driver) }}
93{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_auth_version -}}
94{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_auth_version" "3" -}}
95{{- end -}}
96{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_auth_url -}}
97{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.cinder.DEFAULT "backup_swift_auth_url" -}}
98{{- end -}}
99{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_user_domain -}}
100{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_user_domain" .Values.endpoints.identity.auth.cinder.user_domain_name -}}
101{{- end -}}
102{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_user -}}
103{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_user" .Values.endpoints.identity.auth.cinder.username -}}
104{{- end -}}
105{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_key -}}
106{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_key" .Values.endpoints.identity.auth.cinder.password -}}
107{{- end -}}
108{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_project_domain -}}
109{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_project_domain" .Values.endpoints.identity.auth.cinder.project_domain_name -}}
110{{- end -}}
111{{- if empty .Values.conf.cinder.DEFAULT.backup_swift_project -}}
112{{- $_ := set .Values.conf.cinder.DEFAULT "backup_swift_project" .Values.endpoints.identity.auth.cinder.project_name -}}
113{{- end -}}
114{{- if empty .Values.conf.cinder.DEFAULT.swift_catalog_info -}}
115{{- $_ := set .Values.conf.cinder.DEFAULT "swift_catalog_info" "object-store:swift:internalURL" -}}
116{{- end -}}
117{{- end -}}
118
119{{- if empty .Values.conf.cinder.DEFAULT.osapi_volume_listen_port -}}
Oleksandr Kozachenkoa10d7852023-02-02 22:01:16 +0100120{{- $_ := tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.cinder.DEFAULT "osapi_volume_listen_port" -}}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500121{{- end -}}
122
123{{- if .Values.conf.cinder.service_user.send_service_user_token -}}
124{{- if empty .Values.conf.cinder.service_user.auth_url -}}
125{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.cinder.service_user "auth_url" -}}
126{{- end -}}
127{{- if empty .Values.conf.cinder.service_user.region_name -}}
128{{- $_ := set .Values.conf.cinder.service_user "region_name" .Values.endpoints.identity.auth.cinder.region_name -}}
129{{- end -}}
130{{- if empty .Values.conf.cinder.service_user.project_name -}}
131{{- $_ := set .Values.conf.cinder.service_user "project_name" .Values.endpoints.identity.auth.cinder.project_name -}}
132{{- end -}}
133{{- if empty .Values.conf.cinder.service_user.project_domain_name -}}
134{{- $_ := set .Values.conf.cinder.service_user "project_domain_name" .Values.endpoints.identity.auth.cinder.project_domain_name -}}
135{{- end -}}
136{{- if empty .Values.conf.cinder.service_user.user_domain_name -}}
137{{- $_ := set .Values.conf.cinder.service_user "user_domain_name" .Values.endpoints.identity.auth.cinder.user_domain_name -}}
138{{- end -}}
139{{- if empty .Values.conf.cinder.service_user.username -}}
140{{- $_ := set .Values.conf.cinder.service_user "username" .Values.endpoints.identity.auth.cinder.username -}}
141{{- end -}}
142{{- if empty .Values.conf.cinder.service_user.password -}}
143{{- $_ := set .Values.conf.cinder.service_user "password" .Values.endpoints.identity.auth.cinder.password -}}
144{{- end -}}
145{{- end -}}
146
Oleksandr Kozachenko7ac2d722023-10-03 15:19:33 +0200147{{- if empty .Values.conf.cinder_api_uwsgi.uwsgi.processes -}}
148{{- $_ := set .Values.conf.cinder_api_uwsgi.uwsgi "processes" .Values.conf.cinder.DEFAULT.osapi_volume_workers -}}
149{{- end -}}
150{{- if empty (index .Values.conf.cinder_api_uwsgi.uwsgi "http-socket") -}}
151{{- $http_socket_port := tuple "volume" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }}
152{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }}
153{{- $_ := set .Values.conf.cinder_api_uwsgi.uwsgi "http-socket" $http_socket -}}
154{{- end -}}
155
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500156{{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}}
157{{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
158{{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
159{{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }}
160{{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}}
161{{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}}
162{{- end -}}
163
164{{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}}
165{{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}}
166{{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}}
167{{- end -}}
Dong Ma0a05b5c2024-11-24 13:27:29 +0800168
169{{- range $key, $backend := .Values.conf.backends }}
170{{- if and $backend.nfs_shares_config (not $backend.nfs_shares_config_content) }}
171{{- $nfs_shares_config_content := $backend.nfs_shares_config }}
172{{- $_ := set $backend "nfs_shares_config_content" $nfs_shares_config_content -}}
173{{- $_ := set $backend "nfs_shares_config" (printf "/etc/cinder/nfs/%s" $key) -}}
174{{- end -}}
175{{- end -}}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500176---
177apiVersion: v1
178kind: Secret
179metadata:
180 name: cinder-etc
181type: Opaque
182data:
183 rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }}
184 cinder.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.cinder | b64enc }}
185 logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }}
186 backends.conf: {{ include "helm-toolkit.utils.to_ini" .Values.conf.backends | b64enc }}
187 api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }}
Oleksandr Kozachenko7ac2d722023-10-03 15:19:33 +0200188 cinder-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.cinder_api_uwsgi | b64enc }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500189 policy.yaml: {{ toYaml .Values.conf.policy | b64enc }}
190{{- if .Values.manifests.certificates }}
191{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.mpm_event "key" "mpm_event.conf" "format" "Secret" ) | indent 2 }}
192{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.wsgi_cinder "key" "wsgi-cinder.conf" "format" "Secret" ) | indent 2 }}
193{{- end }}
194 api_audit_map.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.api_audit_map | b64enc }}
195 cinder_sudoers: {{ $envAll.Values.conf.cinder_sudoers | b64enc }}
196 rootwrap.conf: {{ $envAll.Values.conf.rootwrap | b64enc }}
197 resource_filters.json: {{ toJson .Values.conf.resource_filters | b64enc }}
198{{- range $key, $value := $envAll.Values.conf.rootwrap_filters }}
199{{- $filePrefix := replace "_" "-" $key }}
200 {{ printf "%s.filters" $filePrefix }}: {{ $value.content | b64enc }}
201{{- end }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000202{{- if and .Values.backup.external_ceph_rbd.enabled (not .Values.backup.external_ceph_rbd.configmap) }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500203 external-backup-ceph.conf: {{ include "helm-toolkit.utils.to_ini" .Values.backup.external_ceph_rbd.conf | b64enc }}
204{{- end }}
Mohammed Naserbcdd25c2023-01-18 03:38:47 +0000205{{- if and .Values.ceph_client.enable_external_ceph_backend (not .Values.ceph_client.external_ceph.configmap) }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -0500206 external-ceph.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.ceph_client.external_ceph.conf | b64enc }}
207{{- end }}
208{{- end }}
Dong Ma0a05b5c2024-11-24 13:27:29 +0800209{{- range $key, $backend := .Values.conf.backends }}
210{{- if $backend.nfs_shares_config }}
211 nfs-{{ $key }}: |
212 {{- if kindIs "string" $backend.nfs_shares_config_content }}
213 {{ $backend.nfs_shares_config_content | b64enc }}
214 {{- else if kindIs "slice" $backend.nfs_shares_config_content }}
215 {{ $backend.nfs_shares_config_content | join "\n" | b64enc }}
216 {{- end }}
217{{- end }}
218{{- end }}