blob: 8b253360cc11ae6e8b18dc11b302d0bbd5d49508 [file] [log] [blame]
Mohammed Naser298f0272024-07-29 18:43:25 -04001{{/*
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.ironic.keystone_authtoken.auth_uri -}}
19{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.keystone_authtoken "auth_uri" -}}
20{{- end -}}
21{{- if empty .Values.conf.ironic.keystone_authtoken.auth_url -}}
22{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.keystone_authtoken "auth_url" -}}
23{{- end -}}
24{{- if empty .Values.conf.ironic.keystone_authtoken.region_name -}}
25{{- $_ := set .Values.conf.ironic.keystone_authtoken "region_name" .Values.endpoints.identity.auth.ironic.region_name -}}
26{{- end -}}
27{{- if empty .Values.conf.ironic.keystone_authtoken.project_name -}}
28{{- $_ := set .Values.conf.ironic.keystone_authtoken "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
29{{- end -}}
30{{- if empty .Values.conf.ironic.keystone_authtoken.project_domain_name -}}
31{{- $_ := set .Values.conf.ironic.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
32{{- end -}}
33{{- if empty .Values.conf.ironic.keystone_authtoken.user_domain_name -}}
34{{- $_ := set .Values.conf.ironic.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
35{{- end -}}
36{{- if empty .Values.conf.ironic.keystone_authtoken.username -}}
37{{- $_ := set .Values.conf.ironic.keystone_authtoken "username" .Values.endpoints.identity.auth.ironic.username -}}
38{{- end -}}
39{{- if empty .Values.conf.ironic.keystone_authtoken.password -}}
40{{- $_ := set .Values.conf.ironic.keystone_authtoken "password" .Values.endpoints.identity.auth.ironic.password -}}
41{{- end -}}
42
43{{- if empty .Values.conf.ironic.keystone_authtoken.memcached_servers -}}
44{{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.ironic.keystone_authtoken "memcached_servers" -}}
45{{- end -}}
46{{- if empty .Values.conf.ironic.keystone_authtoken.memcache_secret_key -}}
47{{- $_ := set .Values.conf.ironic.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
48{{- end -}}
49
Oleksandr K.ae821ee2024-08-08 20:00:26 +020050{{- if .Values.conf.ironic.service_user.send_service_user_token -}}
51
52{{- if empty .Values.conf.ironic.service_user.auth_url -}}
53{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.ironic.service_user "auth_url" -}}
54{{- end -}}
55{{- if empty .Values.conf.ironic.service_user.region_name -}}
56{{- $_ := set .Values.conf.ironic.service_user "region_name" .Values.endpoints.identity.auth.ironic.region_name -}}
57{{- end -}}
58{{- if empty .Values.conf.ironic.service_user.project_name -}}
59{{- $_ := set .Values.conf.ironic.service_user "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
60{{- end -}}
61{{- if empty .Values.conf.ironic.service_user.project_domain_name -}}
62{{- $_ := set .Values.conf.ironic.service_user "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
63{{- end -}}
64{{- if empty .Values.conf.ironic.service_user.user_domain_name -}}
65{{- $_ := set .Values.conf.ironic.service_user "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
66{{- end -}}
67{{- if empty .Values.conf.ironic.service_user.username -}}
68{{- $_ := set .Values.conf.ironic.service_user "username" .Values.endpoints.identity.auth.ironic.username -}}
69{{- end -}}
70{{- if empty .Values.conf.ironic.service_user.password -}}
71{{- $_ := set .Values.conf.ironic.service_user "password" .Values.endpoints.identity.auth.ironic.password -}}
72{{- end -}}
73
74{{- end -}}
75
Mohammed Naser298f0272024-07-29 18:43:25 -040076{{- if empty .Values.conf.ironic.database.connection -}}
77{{- $_ := tuple "oslo_db" "internal" "ironic" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.ironic.database "connection" -}}
78{{- end -}}
79
80{{- if empty .Values.conf.ironic.DEFAULT.transport_url -}}
81{{- $_ := tuple "oslo_messaging" "internal" "ironic" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.ironic.DEFAULT "transport_url" -}}
82{{- end -}}
83
84{{- if empty .Values.conf.ironic.glance.glance_host -}}
85{{- $_ := tuple "image" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup"| set .Values.conf.ironic.glance "glance_host" -}}
86{{- end -}}
87{{- if empty .Values.conf.ironic.glance.glance_port -}}
88{{- $_ := tuple "image" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup"| set .Values.conf.ironic.glance "glance_port" -}}
89{{- end -}}
90
91{{- if empty .Values.conf.ironic.glance.auth_url -}}
92{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.glance "auth_url" -}}
93{{- end -}}
94{{- if empty .Values.conf.ironic.glance.project_name -}}
95{{- $_ := set .Values.conf.ironic.glance "project_name" .Values.endpoints.identity.auth.glance.project_name -}}
96{{- end -}}
97{{- if empty .Values.conf.ironic.glance.project_domain_name -}}
98{{- $_ := set .Values.conf.ironic.glance "project_domain_name" .Values.endpoints.identity.auth.glance.project_domain_name -}}
99{{- end -}}
100{{- if empty .Values.conf.ironic.glance.user_domain_name -}}
101{{- $_ := set .Values.conf.ironic.glance "user_domain_name" .Values.endpoints.identity.auth.glance.user_domain_name -}}
102{{- end -}}
103{{- if empty .Values.conf.ironic.glance.username -}}
104{{- $_ := set .Values.conf.ironic.glance "username" .Values.endpoints.identity.auth.glance.username -}}
105{{- end -}}
106{{- if empty .Values.conf.ironic.glance.password -}}
107{{- $_ := set .Values.conf.ironic.glance "password" .Values.endpoints.identity.auth.glance.password -}}
108{{- end -}}
109
110
111{{- if empty .Values.conf.ironic.inspector.auth_url -}}
112{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.inspector "auth_url" -}}
113{{- end -}}
114{{- if empty .Values.conf.ironic.inspector.project_name -}}
115{{- $_ := set .Values.conf.ironic.inspector "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
116{{- end -}}
117{{- if empty .Values.conf.ironic.inspector.project_domain_name -}}
118{{- $_ := set .Values.conf.ironic.inspector "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
119{{- end -}}
120{{- if empty .Values.conf.ironic.inspector.user_domain_name -}}
121{{- $_ := set .Values.conf.ironic.inspector "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
122{{- end -}}
123{{- if empty .Values.conf.ironic.inspector.username -}}
124{{- $_ := set .Values.conf.ironic.inspector "username" .Values.endpoints.identity.auth.ironic.username -}}
125{{- end -}}
126{{- if empty .Values.conf.ironic.inspector.password -}}
127{{- $_ := set .Values.conf.ironic.inspector "password" .Values.endpoints.identity.auth.ironic.password -}}
128{{- end -}}
129
130
131{{- if empty .Values.conf.ironic.neutron.url -}}
132{{- $_ := tuple "network" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.neutron "url" -}}
133{{- end -}}
134{{- if empty .Values.conf.ironic.neutron.auth_url -}}
135{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.neutron "auth_url" -}}
136{{- end -}}
137{{- if empty .Values.conf.ironic.neutron.project_name -}}
138{{- $_ := set .Values.conf.ironic.neutron "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
139{{- end -}}
140{{- if empty .Values.conf.ironic.neutron.project_domain_name -}}
141{{- $_ := set .Values.conf.ironic.neutron "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
142{{- end -}}
143{{- if empty .Values.conf.ironic.neutron.user_domain_name -}}
144{{- $_ := set .Values.conf.ironic.neutron "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
145{{- end -}}
146{{- if empty .Values.conf.ironic.neutron.username -}}
147{{- $_ := set .Values.conf.ironic.neutron "username" .Values.endpoints.identity.auth.ironic.username -}}
148{{- end -}}
149{{- if empty .Values.conf.ironic.neutron.password -}}
150{{- $_ := set .Values.conf.ironic.neutron "password" .Values.endpoints.identity.auth.ironic.password -}}
151{{- end -}}
152
153{{- if empty .Values.conf.ironic.service_catalog.auth_url -}}
154{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.service_catalog "auth_url" -}}
155{{- end -}}
156{{- if empty .Values.conf.ironic.service_catalog.project_name -}}
157{{- $_ := set .Values.conf.ironic.service_catalog "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
158{{- end -}}
159{{- if empty .Values.conf.ironic.service_catalog.project_domain_name -}}
160{{- $_ := set .Values.conf.ironic.service_catalog "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
161{{- end -}}
162{{- if empty .Values.conf.ironic.service_catalog.user_domain_name -}}
163{{- $_ := set .Values.conf.ironic.service_catalog "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
164{{- end -}}
165{{- if empty .Values.conf.ironic.service_catalog.username -}}
166{{- $_ := set .Values.conf.ironic.service_catalog "username" .Values.endpoints.identity.auth.ironic.username -}}
167{{- end -}}
168{{- if empty .Values.conf.ironic.service_catalog.password -}}
169{{- $_ := set .Values.conf.ironic.service_catalog "password" .Values.endpoints.identity.auth.ironic.password -}}
170{{- end -}}
171
172{{- if empty .Values.conf.ironic.swift.auth_url -}}
173{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.swift "auth_url" -}}
174{{- end -}}
175{{- if empty .Values.conf.ironic.swift.project_name -}}
176{{- $_ := set .Values.conf.ironic.swift "project_name" .Values.endpoints.identity.auth.ironic.project_name -}}
177{{- end -}}
178{{- if empty .Values.conf.ironic.swift.project_domain_name -}}
179{{- $_ := set .Values.conf.ironic.swift "project_domain_name" .Values.endpoints.identity.auth.ironic.project_domain_name -}}
180{{- end -}}
181{{- if empty .Values.conf.ironic.swift.user_domain_name -}}
182{{- $_ := set .Values.conf.ironic.swift "user_domain_name" .Values.endpoints.identity.auth.ironic.user_domain_name -}}
183{{- end -}}
184{{- if empty .Values.conf.ironic.swift.username -}}
185{{- $_ := set .Values.conf.ironic.swift "username" .Values.endpoints.identity.auth.ironic.username -}}
186{{- end -}}
187{{- if empty .Values.conf.ironic.swift.password -}}
188{{- $_ := set .Values.conf.ironic.swift "password" .Values.endpoints.identity.auth.ironic.password -}}
189{{- end -}}
190
191{{- if empty .Values.conf.ironic.conductor.api_url -}}
192{{- $_ := tuple "baremetal" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.conductor "api_url" -}}
193{{- end -}}
194
195{{- if empty .Values.conf.ironic.api.public_endpoint -}}
196{{- $_ := tuple "baremetal" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.ironic.api "public_endpoint" -}}
197{{- end -}}
198
199{{- if empty .Values.conf.ironic.glance.swift_endpoint_url -}}
200{{- $_ := tuple "object_store" "public" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| trimSuffix .Values.endpoints.object_store.path.default | set .Values.conf.ironic.glance "swift_endpoint_url" -}}
201{{- end -}}
202
203{{- if empty .Values.conf.ironic.glance.swift_temp_url_key -}}
204{{- $_ := set .Values.conf.ironic.glance "swift_temp_url_key" .Values.endpoints.object_store.auth.glance.tmpurlkey -}}
205{{- end -}}
206
207{{- if empty .Values.conf.ironic.api.port -}}
208{{- $_ := set .Values.conf.ironic.api "port" (tuple "baremetal" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup") -}}
209{{- end -}}
210
211{{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}}
212{{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }}
213{{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
214{{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }}
215{{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}}
216{{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}}
217{{- end -}}
218
219{{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}}
220{{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}}
221{{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}}
222{{- end -}}
223---
224apiVersion: v1
225kind: Secret
226metadata:
227 name: ironic-etc
228type: Opaque
229data:
230 ironic.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.ironic | b64enc }}
231 logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }}
232 policy.yaml: {{ toYaml .Values.conf.policy | b64enc }}
233{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.tftp_map_file "key" "tftp-map-file" "format" "Secret" ) | indent 2 }}
234{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.nginx "key" "nginx.conf" "format" "Secret" ) | indent 2 }}
235{{- end }}