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.senlin.keystone_authtoken.auth_uri -}} |
| 19 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.senlin.keystone_authtoken "auth_uri" -}} |
| 20 | {{- end -}} |
| 21 | |
| 22 | # FIXME(alanmeadows) fix for broken keystonemiddleware oslo config gen in newton - will remove in future |
| 23 | {{- if empty .Values.conf.senlin.keystone_authtoken.auth_url -}} |
| 24 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.senlin.keystone_authtoken "auth_url" -}} |
| 25 | {{- end -}} |
| 26 | |
| 27 | {{- if empty .Values.conf.senlin.keystone_authtoken.region_name -}} |
| 28 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "region_name" .Values.endpoints.identity.auth.senlin.region_name -}} |
| 29 | {{- end -}} |
| 30 | {{- if empty .Values.conf.senlin.keystone_authtoken.project_name -}} |
| 31 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "project_name" .Values.endpoints.identity.auth.senlin.project_name -}} |
| 32 | {{- end -}} |
| 33 | {{- if empty .Values.conf.senlin.keystone_authtoken.project_domain_name -}} |
| 34 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.senlin.project_domain_name -}} |
| 35 | {{- end -}} |
| 36 | {{- if empty .Values.conf.senlin.keystone_authtoken.user_domain_name -}} |
| 37 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.senlin.user_domain_name -}} |
| 38 | {{- end -}} |
| 39 | {{- if empty .Values.conf.senlin.keystone_authtoken.username -}} |
| 40 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "username" .Values.endpoints.identity.auth.senlin.username -}} |
| 41 | {{- end -}} |
| 42 | {{- if empty .Values.conf.senlin.keystone_authtoken.password -}} |
| 43 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "password" .Values.endpoints.identity.auth.senlin.password -}} |
| 44 | {{- end -}} |
| 45 | |
| 46 | {{- if empty .Values.conf.senlin.keystone_authtoken.memcached_servers -}} |
| 47 | {{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.senlin.keystone_authtoken "memcached_servers" -}} |
| 48 | {{- end -}} |
| 49 | {{- if empty .Values.conf.senlin.keystone_authtoken.memcache_secret_key -}} |
| 50 | {{- $_ := set .Values.conf.senlin.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}} |
| 51 | {{- end -}} |
| 52 | |
| 53 | {{- if empty .Values.conf.senlin.database.connection -}} |
| 54 | {{- $_ := tuple "oslo_db" "internal" "senlin" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.senlin.database "connection" -}} |
| 55 | {{- end -}} |
| 56 | |
| 57 | {{- if empty .Values.conf.senlin.DEFAULT.transport_url -}} |
| 58 | {{- $_ := tuple "oslo_messaging" "internal" "senlin" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.senlin.DEFAULT "transport_url" -}} |
| 59 | {{- end -}} |
| 60 | |
| 61 | {{- if empty .Values.conf.senlin.senlin_api.bind_port -}} |
| 62 | {{- $_ := tuple "clustering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | set .Values.conf.senlin.senlin_api "bind_port" -}} |
| 63 | {{- end -}} |
| 64 | |
| 65 | {{- if empty .Values.conf.senlin.authentication.auth_url -}} |
| 66 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.senlin.authentication "auth_url" -}} |
| 67 | {{- end -}} |
| 68 | {{- if empty .Values.conf.senlin.authentication.service_password -}} |
| 69 | {{- $_ := set .Values.conf.senlin.authentication "service_password" .Values.endpoints.identity.auth.senlin.password -}} |
| 70 | {{- end -}} |
| 71 | {{- if empty .Values.conf.senlin.authentication.service_project_domain -}} |
| 72 | {{- $_ := set .Values.conf.senlin.authentication "service_project_domain" .Values.endpoints.identity.auth.senlin.project_domain_name -}} |
| 73 | {{- end -}} |
| 74 | {{- if empty .Values.conf.senlin.authentication.service_project_name -}} |
| 75 | {{- $_ := set .Values.conf.senlin.authentication "service_project_name" .Values.endpoints.identity.auth.senlin.project_name -}} |
| 76 | {{- end -}} |
| 77 | {{- if empty .Values.conf.senlin.authentication.service_user_domain -}} |
| 78 | {{- $_ := set .Values.conf.senlin.authentication "service_user_domain" .Values.endpoints.identity.auth.senlin.user_domain_name -}} |
| 79 | {{- end -}} |
| 80 | {{- if empty .Values.conf.senlin.authentication.service_username -}} |
| 81 | {{- $_ := set .Values.conf.senlin.authentication "service_username" .Values.endpoints.identity.auth.senlin.username -}} |
| 82 | {{- end -}} |
| 83 | |
Oleksandr Kozachenko | 42cd761 | 2023-10-20 15:36:38 +0200 | [diff] [blame] | 84 | {{- if empty .Values.conf.senlin_api_uwsgi.uwsgi.processes -}} |
| 85 | {{- $_ := set .Values.conf.senlin_api_uwsgi.uwsgi "processes" .Values.conf.senlin.senlin_api.workers -}} |
| 86 | {{- end -}} |
| 87 | {{- if empty (index .Values.conf.senlin_api_uwsgi.uwsgi "http-socket") -}} |
| 88 | {{- $http_socket_port := tuple "clustering" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }} |
| 89 | {{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }} |
| 90 | {{- $_ := set .Values.conf.senlin_api_uwsgi.uwsgi "http-socket" $http_socket -}} |
| 91 | {{- end -}} |
| 92 | |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 93 | {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} |
| 94 | {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} |
| 95 | {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 96 | {{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }} |
| 97 | {{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}} |
| 98 | {{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}} |
| 99 | {{- end -}} |
| 100 | |
| 101 | {{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}} |
| 102 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 103 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 104 | {{- end -}} |
| 105 | --- |
| 106 | apiVersion: v1 |
| 107 | kind: Secret |
| 108 | metadata: |
| 109 | name: senlin-etc |
| 110 | type: Opaque |
| 111 | data: |
| 112 | rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }} |
| 113 | senlin.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.senlin | b64enc }} |
Oleksandr Kozachenko | 42cd761 | 2023-10-20 15:36:38 +0200 | [diff] [blame] | 114 | senlin-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.senlin_api_uwsgi | b64enc }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 115 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} |
| 116 | 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] | 117 | policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} |
| 118 | {{- end }} |