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 | |
| 15 | {{- if .Values.manifests.configmap_etc }} |
| 16 | {{- $envAll := . }} |
| 17 | |
| 18 | {{- if empty .Values.conf.magnum.keystone_authtoken.auth_uri -}} |
| 19 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.magnum.keystone_authtoken "auth_uri" -}} |
| 20 | {{- end -}} |
| 21 | |
| 22 | {{- if empty .Values.conf.magnum.keystone_authtoken.auth_url -}} |
| 23 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.magnum.keystone_authtoken "auth_url" -}} |
| 24 | {{- end -}} |
| 25 | |
| 26 | {{- if empty .Values.conf.magnum.keystone_authtoken.region_name -}} |
| 27 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "region_name" .Values.endpoints.identity.auth.magnum.region_name -}} |
| 28 | {{- end -}} |
| 29 | {{- if empty .Values.conf.magnum.keystone_authtoken.project_name -}} |
| 30 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "project_name" .Values.endpoints.identity.auth.magnum.project_name -}} |
| 31 | {{- end -}} |
| 32 | {{- if empty .Values.conf.magnum.keystone_authtoken.project_domain_name -}} |
| 33 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.magnum.project_domain_name -}} |
| 34 | {{- end -}} |
| 35 | {{- if empty .Values.conf.magnum.keystone_authtoken.user_domain_name -}} |
| 36 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.magnum.user_domain_name -}} |
| 37 | {{- end -}} |
| 38 | {{- if empty .Values.conf.magnum.keystone_authtoken.username -}} |
| 39 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "username" .Values.endpoints.identity.auth.magnum.username -}} |
| 40 | {{- end -}} |
| 41 | {{- if empty .Values.conf.magnum.keystone_authtoken.password -}} |
| 42 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "password" .Values.endpoints.identity.auth.magnum.password -}} |
| 43 | {{- end -}} |
| 44 | |
| 45 | {{- if empty .Values.conf.magnum.keystone_authtoken.memcached_servers -}} |
| 46 | {{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.magnum.keystone_authtoken "memcached_servers" -}} |
| 47 | {{- end -}} |
| 48 | {{- if empty .Values.conf.magnum.keystone_authtoken.memcache_secret_key -}} |
| 49 | {{- $_ := set .Values.conf.magnum.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}} |
| 50 | {{- end -}} |
| 51 | |
| 52 | {{- if empty .Values.conf.magnum.database.connection -}} |
| 53 | {{- $_ := tuple "oslo_db" "internal" "magnum" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.magnum.database "connection" -}} |
| 54 | {{- end -}} |
| 55 | |
| 56 | {{- if empty .Values.conf.magnum.DEFAULT.transport_url -}} |
| 57 | {{- $_ := tuple "oslo_messaging" "internal" "magnum" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.magnum.DEFAULT "transport_url" -}} |
| 58 | {{- end -}} |
| 59 | |
| 60 | {{- if empty .Values.conf.magnum.api.port -}} |
| 61 | {{- $_ := tuple "container-infra" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.magnum.api "port" -}} |
| 62 | {{- end -}} |
| 63 | |
| 64 | {{- if empty .Values.conf.magnum.trust.trustee_domain_name -}} |
| 65 | {{- $_ := set .Values.conf.magnum.trust "trustee_domain_name" .Values.endpoints.identity.auth.magnum_stack_user.domain_name -}} |
| 66 | {{- end -}} |
| 67 | {{- if empty .Values.conf.magnum.trust.trustee_domain_admin_name -}} |
| 68 | {{- $_ := set .Values.conf.magnum.trust "trustee_domain_admin_name" .Values.endpoints.identity.auth.magnum_stack_user.username -}} |
| 69 | {{- end -}} |
| 70 | {{- if empty .Values.conf.magnum.trust.trustee_domain_admin_password -}} |
| 71 | {{- $_ := set .Values.conf.magnum.trust "trustee_domain_admin_password" .Values.endpoints.identity.auth.magnum_stack_user.password -}} |
| 72 | {{- end -}} |
| 73 | |
Oleksandr Kozachenko | 878891e | 2023-10-04 17:36:30 +0200 | [diff] [blame] | 74 | {{- if empty .Values.conf.magnum_api_uwsgi.uwsgi.processes -}} |
| 75 | {{- $_ := set .Values.conf.magnum_api_uwsgi.uwsgi "processes" .Values.conf.magnum.api.workers -}} |
| 76 | {{- end -}} |
| 77 | {{- if empty (index .Values.conf.magnum_api_uwsgi.uwsgi "http-socket") -}} |
| 78 | {{- $http_socket_port := tuple "container-infra" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }} |
| 79 | {{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }} |
| 80 | {{- $_ := set .Values.conf.magnum_api_uwsgi.uwsgi "http-socket" $http_socket -}} |
| 81 | {{- end -}} |
| 82 | |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 83 | {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} |
| 84 | {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} |
| 85 | {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 86 | {{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }} |
| 87 | {{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}} |
| 88 | {{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}} |
| 89 | {{- end -}} |
| 90 | |
| 91 | {{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}} |
| 92 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 93 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 94 | {{- end -}} |
| 95 | --- |
| 96 | apiVersion: v1 |
| 97 | kind: Secret |
| 98 | metadata: |
| 99 | name: magnum-etc |
| 100 | type: Opaque |
| 101 | data: |
| 102 | magnum.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.magnum | b64enc }} |
Oleksandr Kozachenko | 878891e | 2023-10-04 17:36:30 +0200 | [diff] [blame] | 103 | magnum-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.magnum_api_uwsgi | b64enc }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 104 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} |
| 105 | api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 106 | policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} |
| 107 | {{- end }} |