blob: 6b09894e516de5eaab366641b9dba61754f1e06b [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12{{- if .Values.manifests.configmap_etc }}
13
14{{- $envAll := . }}
15
16{{- if empty .Values.conf.designate.keystone_authtoken.auth_uri -}}
17{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.designate.keystone_authtoken "auth_uri" -}}
18{{- end -}}
19
20{{- if empty .Values.conf.designate.keystone_authtoken.auth_url -}}
21{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.designate.keystone_authtoken "auth_url" -}}
22{{- end -}}
23
24{{- if empty .Values.conf.designate.keystone_authtoken.region_name -}}
25{{- $_ := set .Values.conf.designate.keystone_authtoken "region_name" .Values.endpoints.identity.auth.designate.region_name -}}
26{{- end -}}
27
28{{- if empty .Values.conf.designate.keystone_authtoken.project_name -}}
29{{- $_ := set .Values.conf.designate.keystone_authtoken "project_name" .Values.endpoints.identity.auth.designate.project_name -}}
30{{- end -}}
31
32{{- if empty .Values.conf.designate.keystone_authtoken.project_domain_name -}}
33{{- $_ := set .Values.conf.designate.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.designate.project_domain_name -}}
34{{- end -}}
35
36{{- if empty .Values.conf.designate.keystone_authtoken.user_domain_name -}}
37{{- $_ := set .Values.conf.designate.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.designate.user_domain_name -}}
38{{- end -}}
39
40{{- if empty .Values.conf.designate.keystone_authtoken.username -}}
41{{- $_ := set .Values.conf.designate.keystone_authtoken "username" .Values.endpoints.identity.auth.designate.username -}}
42{{- end -}}
43
44{{- if empty .Values.conf.designate.keystone_authtoken.password -}}
45{{- $_ := set .Values.conf.designate.keystone_authtoken "password" .Values.endpoints.identity.auth.designate.password -}}
46{{- end -}}
47
48{{- if empty .Values.conf.designate.keystone_authtoken.memcached_servers -}}
49{{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.designate.keystone_authtoken "memcached_servers" -}}
50{{- end -}}
51
52{{- if empty .Values.conf.designate.keystone_authtoken.memcache_secret_key -}}
53{{- $_ := set .Values.conf.designate.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
54{{- end -}}
55
56{{- if empty (index .Values.conf.designate "storage:sqlalchemy").connection -}}
57{{- $_ := tuple "oslo_db" "internal" "designate" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set (index .Values.conf.designate "storage:sqlalchemy") "connection" -}}
58{{- $_ := tuple "oslo_db" "internal" "designate" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.designate.database "connection" -}}
59{{- end -}}
60
61{{- if empty .Values.conf.designate.DEFAULT.transport_url -}}
62{{- $_ := tuple "oslo_messaging" "internal" "designate" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.designate.DEFAULT "transport_url" -}}
63{{- end -}}
64
65{{- if empty (index .Values.conf.designate "service:api").api_base_uri -}}
66{{- $_ := tuple "dns" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set (index .Values.conf.designate "service:api") "api_base_uri" -}}
67{{- end -}}
Oleksandr Kozachenkoc5f29032023-10-03 15:20:34 +020068
69{{- if empty .Values.conf.designate_api_uwsgi.uwsgi.processes -}}
70{{- $_ := set .Values.conf.designate_api_uwsgi.uwsgi "processes" (index .Values.conf.designate "service:api").workers -}}
71{{- end -}}
72{{- if empty (index .Values.conf.designate_api_uwsgi.uwsgi "http-socket") -}}
73{{- $http_socket_port := tuple "dns" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }}
74{{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }}
75{{- $_ := set .Values.conf.designate_api_uwsgi.uwsgi "http-socket" $http_socket -}}
76{{- end -}}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050077---
78apiVersion: v1
79kind: Secret
80metadata:
81 name: designate-etc
82type: Opaque
83data:
84 designate.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.designate | b64enc }}
Oleksandr Kozachenkoc5f29032023-10-03 15:20:34 +020085 designate-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.designate_api_uwsgi | b64enc }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050086 api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050087 policy.yaml: {{ toYaml .Values.conf.policy | b64enc }}
88 logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }}
89{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.pools "key" "pools.yaml" "format" "Secret" ) | indent 2 }}
90
91{{- end }}