Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019 Intel Corporation. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | {{- if .Values.manifests.configmap_etc }} |
| 18 | {{- $envAll := . }} |
| 19 | |
| 20 | {{- if empty .Values.conf.placement.placement_database.connection -}} |
| 21 | {{- $connection := tuple "oslo_db" "internal" "placement" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}} |
| 22 | {{- if .Values.manifests.certificates -}} |
| 23 | {{- $_ := (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.placement.placement_database "connection" -}} |
| 24 | {{- else -}} |
| 25 | {{- $_ := set .Values.conf.placement.placement_database "connection" $connection -}} |
| 26 | {{- end -}} |
| 27 | {{- end -}} |
| 28 | |
| 29 | {{- if empty .Values.conf.placement.keystone_authtoken.auth_uri -}} |
| 30 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.placement.keystone_authtoken "auth_uri" -}} |
| 31 | {{- end -}} |
| 32 | {{- if empty .Values.conf.placement.keystone_authtoken.auth_url -}} |
| 33 | {{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.placement.keystone_authtoken "auth_url" -}} |
| 34 | {{- end -}} |
| 35 | |
| 36 | {{- if empty .Values.conf.placement.keystone_authtoken.os_region_name -}} |
| 37 | {{- $_ := set .Values.conf.placement.keystone_authtoken "os_region_name" .Values.endpoints.identity.auth.placement.region_name -}} |
| 38 | {{- end -}} |
| 39 | {{- if empty .Values.conf.placement.keystone_authtoken.project_name -}} |
| 40 | {{- $_ := set .Values.conf.placement.keystone_authtoken "project_name" .Values.endpoints.identity.auth.placement.project_name -}} |
| 41 | {{- end -}} |
| 42 | {{- if empty .Values.conf.placement.keystone_authtoken.project_domain_name -}} |
| 43 | {{- $_ := set .Values.conf.placement.keystone_authtoken "project_domain_name" .Values.endpoints.identity.auth.placement.project_domain_name -}} |
| 44 | {{- end -}} |
| 45 | {{- if empty .Values.conf.placement.keystone_authtoken.user_domain_name -}} |
| 46 | {{- $_ := set .Values.conf.placement.keystone_authtoken "user_domain_name" .Values.endpoints.identity.auth.placement.user_domain_name -}} |
| 47 | {{- end -}} |
| 48 | {{- if empty .Values.conf.placement.keystone_authtoken.username -}} |
| 49 | {{- $_ := set .Values.conf.placement.keystone_authtoken "username" .Values.endpoints.identity.auth.placement.username -}} |
| 50 | {{- end -}} |
| 51 | {{- if empty .Values.conf.placement.keystone_authtoken.password -}} |
| 52 | {{- $_ := set .Values.conf.placement.keystone_authtoken "password" .Values.endpoints.identity.auth.placement.password -}} |
| 53 | {{- end -}} |
| 54 | {{- if empty .Values.conf.placement.keystone_authtoken.memcached_servers -}} |
| 55 | {{- $_ := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.placement.keystone_authtoken "memcached_servers" -}} |
| 56 | {{- end -}} |
| 57 | {{- if empty .Values.conf.placement.keystone_authtoken.memcache_secret_key -}} |
| 58 | {{- $_ := set .Values.conf.placement.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}} |
| 59 | {{- end -}} |
Oleksandr Kozachenko | 57dcd1e | 2023-10-04 17:34:56 +0200 | [diff] [blame] | 60 | |
| 61 | {{- if empty (index .Values.conf.placement_api_uwsgi.uwsgi "http-socket") -}} |
| 62 | {{- $http_socket_port := tuple "placement" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }} |
| 63 | {{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }} |
| 64 | {{- $_ := set .Values.conf.placement_api_uwsgi.uwsgi "http-socket" $http_socket -}} |
| 65 | {{- end -}} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 66 | --- |
| 67 | apiVersion: v1 |
| 68 | kind: Secret |
| 69 | metadata: |
| 70 | name: placement-etc |
| 71 | type: Opaque |
| 72 | data: |
| 73 | policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} |
| 74 | placement.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.placement | b64enc }} |
Oleksandr Kozachenko | 57dcd1e | 2023-10-04 17:34:56 +0200 | [diff] [blame] | 75 | placement-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.placement_api_uwsgi | b64enc }} |
Mohammed Naser | e92e2b0 | 2024-04-20 21:37:11 -0400 | [diff] [blame] | 76 | {{- if .Values.manifests.certificates }} |
| 77 | {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.wsgi_placement "key" "wsgi-placement.conf" "format" "Secret" ) | indent 2 }} |
| 78 | {{- end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 79 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 80 | {{- end }} |