Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | you may not use this file except in compliance with the License. |
| 4 | You may obtain a copy of the License at |
| 5 | |
| 6 | http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | |
| 8 | Unless required by applicable law or agreed to in writing, software |
| 9 | distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | See the License for the specific language governing permissions and |
| 12 | limitations under the License. |
| 13 | */}} |
| 14 | |
Oleksandr Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 15 | {{- if (.Values.global).subchart_release_name }} |
| 16 | {{- $_ := set . "deployment_name" .Chart.Name }} |
| 17 | {{- else }} |
| 18 | {{- $_ := set . "deployment_name" .Release.Name }} |
| 19 | {{- end }} |
| 20 | |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 21 | {{- if .Values.manifests.configmap_etc }} |
| 22 | {{- $envAll := . }} |
| 23 | |
| 24 | {{- if empty .Values.conf.keystone.database.connection -}} |
| 25 | {{- $connection := tuple "oslo_db" "internal" "keystone" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}} |
| 26 | {{- if and .Values.manifests.certificates .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}} |
| 27 | {{- $_ := (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.keystone.database "connection" -}} |
| 28 | {{- else -}} |
| 29 | {{- $_ := set .Values.conf.keystone.database "connection" $connection -}} |
| 30 | {{- end -}} |
| 31 | {{- end -}} |
| 32 | |
| 33 | {{- if empty .Values.conf.keystone.DEFAULT.transport_url -}} |
| 34 | {{- $_ := tuple "oslo_messaging" "internal" "keystone" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.keystone.DEFAULT "transport_url" -}} |
| 35 | {{- end -}} |
| 36 | |
| 37 | {{- if empty .Values.conf.keystone.cache.memcache_servers -}} |
| 38 | {{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.keystone.cache "memcache_servers" -}} |
| 39 | {{- end -}} |
| 40 | |
| 41 | {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} |
| 42 | {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} |
| 43 | {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
Oleksandr Kozachenko | a10d785 | 2023-02-02 22:01:16 +0100 | [diff] [blame] | 44 | {{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .deployment_name $fluentd_host $fluentd_port }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 45 | {{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}} |
| 46 | {{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}} |
| 47 | {{- end -}} |
| 48 | |
| 49 | {{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}} |
| 50 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 51 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 52 | {{- end -}} |
| 53 | --- |
| 54 | apiVersion: v1 |
| 55 | kind: Secret |
| 56 | metadata: |
| 57 | name: keystone-etc |
| 58 | type: Opaque |
| 59 | data: |
| 60 | rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }} |
| 61 | keystone.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.keystone | b64enc }} |
| 62 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" $envAll.Values.conf.logging | b64enc }} |
| 63 | policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} |
| 64 | access_rules.json: {{ toJson .Values.conf.access_rules | b64enc }} |
| 65 | ports.conf: '' |
| 66 | {{- range $k, $v := .Values.conf.ks_domains }} |
Oleksandr Kozachenko | b009349 | 2023-09-06 21:43:47 +0200 | [diff] [blame] | 67 | keystone.{{ $k }}.conf: {{ include "helm-toolkit.utils.to_oslo_conf" $v | b64enc }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 68 | {{- end }} |
| 69 | {{- if .Values.conf.security }} |
| 70 | {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.security "key" "security.conf" "format" "Secret" ) | indent 2 }} |
| 71 | {{- end}} |
| 72 | {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.mpm_event "key" "mpm_event.conf" "format" "Secret" ) | indent 2 }} |
| 73 | {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.wsgi_keystone "key" "wsgi-keystone.conf" "format" "Secret" ) | indent 2 }} |
| 74 | {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.sso_callback_template "key" "sso_callback_template.html" "format" "Secret" ) | indent 2 }} |
| 75 | {{- end }} |