okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [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 | {{- $manila_auth_url := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} |
| 19 | {{- $manila_region_name := .Values.endpoints.identity.auth.manila.region_name }} |
| 20 | {{- $manila_project_name := .Values.endpoints.identity.auth.manila.project_name }} |
| 21 | {{- $manila_project_domain_name := .Values.endpoints.identity.auth.manila.project_domain_name }} |
| 22 | {{- $manila_user_domain_name := .Values.endpoints.identity.auth.manila.user_domain_name }} |
| 23 | {{- $manila_username := .Values.endpoints.identity.auth.manila.username }} |
| 24 | {{- $manila_password := .Values.endpoints.identity.auth.manila.password }} |
| 25 | {{- $memcached_servers := tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }} |
| 26 | {{- $memcache_secret_key := default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key }} |
| 27 | |
| 28 | {{- if empty .Values.conf.manila.keystone_authtoken.auth_uri -}} |
| 29 | {{- $_ := set .Values.conf.manila.keystone_authtoken "auth_uri" $manila_auth_url -}} |
| 30 | {{- end -}} |
| 31 | |
| 32 | {{- if empty .Values.conf.manila.keystone_authtoken.auth_url -}} |
| 33 | {{- $_ := set .Values.conf.manila.keystone_authtoken "auth_url" $manila_auth_url -}} |
| 34 | {{- end -}} |
| 35 | |
| 36 | {{- if empty .Values.conf.manila.keystone_authtoken.region_name -}} |
| 37 | {{- $_ := set .Values.conf.manila.keystone_authtoken "region_name" $manila_region_name -}} |
| 38 | {{- end -}} |
| 39 | {{- if empty .Values.conf.manila.keystone_authtoken.project_name -}} |
| 40 | {{- $_ := set .Values.conf.manila.keystone_authtoken "project_name" $manila_project_name -}} |
| 41 | {{- end -}} |
| 42 | {{- if empty .Values.conf.manila.keystone_authtoken.project_domain_name -}} |
| 43 | {{- $_ := set .Values.conf.manila.keystone_authtoken "project_domain_name" $manila_project_domain_name -}} |
| 44 | {{- end -}} |
| 45 | {{- if empty .Values.conf.manila.keystone_authtoken.user_domain_name -}} |
| 46 | {{- $_ := set .Values.conf.manila.keystone_authtoken "user_domain_name" $manila_user_domain_name -}} |
| 47 | {{- end -}} |
| 48 | {{- if empty .Values.conf.manila.keystone_authtoken.username -}} |
| 49 | {{- $_ := set .Values.conf.manila.keystone_authtoken "username" $manila_username -}} |
| 50 | {{- end -}} |
| 51 | {{- if empty .Values.conf.manila.keystone_authtoken.password -}} |
| 52 | {{- $_ := set .Values.conf.manila.keystone_authtoken "password" $manila_password -}} |
| 53 | {{- end -}} |
| 54 | |
| 55 | {{- if empty .Values.conf.manila.keystone_authtoken.memcached_servers -}} |
| 56 | {{- $_ := set .Values.conf.manila.keystone_authtoken "memcached_servers" $memcached_servers -}} |
| 57 | {{- end -}} |
| 58 | {{- if empty .Values.conf.manila.keystone_authtoken.memcache_secret_key -}} |
| 59 | {{- $_ := set .Values.conf.manila.keystone_authtoken "memcache_secret_key" $memcache_secret_key -}} |
| 60 | {{- end -}} |
| 61 | |
Rico Lin | 59516f6 | 2023-10-04 23:25:47 +0800 | [diff] [blame] | 62 | {{- if not .Values.conf.paste }} |
| 63 | {{- $_ := set $envAll.Values.conf.manila.DEFAULT "api_paste_config" "/var/lib/openstack/etc/manila/api-paste.ini" -}} |
| 64 | {{- end }} |
| 65 | |
okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [diff] [blame] | 66 | {{- if empty .Values.conf.manila.database.connection -}} |
| 67 | {{- $_ := tuple "oslo_db" "internal" "manila" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.manila.database "connection" -}} |
| 68 | {{- end -}} |
| 69 | |
| 70 | {{- if empty .Values.conf.manila.DEFAULT.transport_url -}} |
| 71 | {{- $_ := tuple "oslo_messaging" "internal" "manila" "amqp" . | include "helm-toolkit.endpoints.authenticated_transport_endpoint_uri_lookup" | set .Values.conf.manila.DEFAULT "transport_url" -}} |
| 72 | {{- end -}} |
| 73 | |
| 74 | # neutron |
| 75 | {{- if empty .Values.conf.manila.neutron.auth_uri -}} |
| 76 | {{- $_ := set .Values.conf.manila.neutron "auth_uri" $manila_auth_url -}} |
| 77 | {{- end -}} |
| 78 | |
| 79 | {{- if empty .Values.conf.manila.neutron.auth_url -}} |
| 80 | {{- $_ := set .Values.conf.manila.neutron "auth_url" $manila_auth_url -}} |
| 81 | {{- end -}} |
| 82 | |
| 83 | {{- if empty .Values.conf.manila.neutron.region_name -}} |
| 84 | {{- $_ := set .Values.conf.manila.neutron "region_name" .Values.endpoints.identity.auth.manila.region_name -}} |
| 85 | {{- end -}} |
| 86 | {{- if empty .Values.conf.manila.neutron.project_name -}} |
| 87 | {{- $_ := set .Values.conf.manila.neutron "project_name" $manila_project_name -}} |
| 88 | {{- end -}} |
| 89 | {{- if empty .Values.conf.manila.neutron.project_domain_name -}} |
| 90 | {{- $_ := set .Values.conf.manila.neutron "project_domain_name" $manila_project_domain_name -}} |
| 91 | {{- end -}} |
| 92 | {{- if empty .Values.conf.manila.neutron.user_domain_name -}} |
| 93 | {{- $_ := set .Values.conf.manila.neutron "user_domain_name" $manila_user_domain_name -}} |
| 94 | {{- end -}} |
| 95 | {{- if empty .Values.conf.manila.neutron.username -}} |
| 96 | {{- $_ := set .Values.conf.manila.neutron "username" $manila_username -}} |
| 97 | {{- end -}} |
| 98 | {{- if empty .Values.conf.manila.neutron.password -}} |
| 99 | {{- $_ := set .Values.conf.manila.neutron "password" $manila_password -}} |
| 100 | {{- end -}} |
| 101 | |
| 102 | {{- if empty .Values.conf.manila.neutron.memcached_servers -}} |
| 103 | {{- $_ := set .Values.conf.manila.neutron "memcached_servers" $memcached_servers -}} |
| 104 | {{- end -}} |
| 105 | {{- if empty .Values.conf.manila.neutron.memcache_secret_key -}} |
| 106 | {{- $_ := set .Values.conf.manila.neutron "memcache_secret_key" $memcache_secret_key -}} |
| 107 | {{- end -}} |
| 108 | |
| 109 | # nova |
| 110 | {{- if empty .Values.conf.manila.nova.auth_uri -}} |
| 111 | {{- $_ := set .Values.conf.manila.nova "auth_uri" $manila_auth_url -}} |
| 112 | {{- end -}} |
| 113 | |
| 114 | {{- if empty .Values.conf.manila.nova.auth_url -}} |
| 115 | {{- $_ := set .Values.conf.manila.nova "auth_url" $manila_auth_url -}} |
| 116 | {{- end -}} |
| 117 | |
| 118 | {{- if empty .Values.conf.manila.nova.region_name -}} |
| 119 | {{- $_ := set .Values.conf.manila.nova "region_name" .Values.endpoints.identity.auth.manila.region_name -}} |
| 120 | {{- end -}} |
| 121 | {{- if empty .Values.conf.manila.nova.project_name -}} |
| 122 | {{- $_ := set .Values.conf.manila.nova "project_name" $manila_project_name -}} |
| 123 | {{- end -}} |
| 124 | {{- if empty .Values.conf.manila.nova.project_domain_name -}} |
| 125 | {{- $_ := set .Values.conf.manila.nova "project_domain_name" $manila_project_domain_name -}} |
| 126 | {{- end -}} |
| 127 | {{- if empty .Values.conf.manila.nova.user_domain_name -}} |
| 128 | {{- $_ := set .Values.conf.manila.nova "user_domain_name" $manila_user_domain_name -}} |
| 129 | {{- end -}} |
| 130 | {{- if empty .Values.conf.manila.nova.username -}} |
| 131 | {{- $_ := set .Values.conf.manila.nova "username" $manila_username -}} |
| 132 | {{- end -}} |
| 133 | {{- if empty .Values.conf.manila.nova.password -}} |
| 134 | {{- $_ := set .Values.conf.manila.nova "password" $manila_password -}} |
| 135 | {{- end -}} |
| 136 | |
| 137 | {{- if empty .Values.conf.manila.nova.memcached_servers -}} |
| 138 | {{- $_ := set .Values.conf.manila.nova "memcached_servers" $memcached_servers -}} |
| 139 | {{- end -}} |
| 140 | {{- if empty .Values.conf.manila.nova.memcache_secret_key -}} |
| 141 | {{- $_ := set .Values.conf.manila.nova "memcache_secret_key" $memcache_secret_key -}} |
| 142 | {{- end -}} |
| 143 | |
| 144 | # cinder |
| 145 | {{- if empty .Values.conf.manila.cinder.auth_uri -}} |
| 146 | {{- $_ := set .Values.conf.manila.cinder "auth_uri" $manila_auth_url -}} |
| 147 | {{- end -}} |
| 148 | |
| 149 | {{- if empty .Values.conf.manila.cinder.auth_url -}} |
| 150 | {{- $_ := set .Values.conf.manila.cinder "auth_url" $manila_auth_url -}} |
| 151 | {{- end -}} |
| 152 | |
| 153 | {{- if empty .Values.conf.manila.cinder.region_name -}} |
| 154 | {{- $_ := set .Values.conf.manila.cinder "region_name" .Values.endpoints.identity.auth.manila.region_name -}} |
| 155 | {{- end -}} |
| 156 | {{- if empty .Values.conf.manila.cinder.project_name -}} |
| 157 | {{- $_ := set .Values.conf.manila.cinder "project_name" $manila_project_name -}} |
| 158 | {{- end -}} |
| 159 | {{- if empty .Values.conf.manila.cinder.project_domain_name -}} |
| 160 | {{- $_ := set .Values.conf.manila.cinder "project_domain_name" $manila_project_domain_name -}} |
| 161 | {{- end -}} |
| 162 | {{- if empty .Values.conf.manila.cinder.user_domain_name -}} |
| 163 | {{- $_ := set .Values.conf.manila.cinder "user_domain_name" $manila_user_domain_name -}} |
| 164 | {{- end -}} |
| 165 | {{- if empty .Values.conf.manila.cinder.username -}} |
| 166 | {{- $_ := set .Values.conf.manila.cinder "username" $manila_username -}} |
| 167 | {{- end -}} |
| 168 | {{- if empty .Values.conf.manila.cinder.password -}} |
| 169 | {{- $_ := set .Values.conf.manila.cinder "password" $manila_password -}} |
| 170 | {{- end -}} |
| 171 | |
| 172 | {{- if empty .Values.conf.manila.cinder.memcached_servers -}} |
| 173 | {{- $_ := set .Values.conf.manila.cinder "memcached_servers" $memcached_servers -}} |
| 174 | {{- end -}} |
| 175 | {{- if empty .Values.conf.manila.cinder.memcache_secret_key -}} |
| 176 | {{- $_ := set .Values.conf.manila.cinder "memcache_secret_key" $memcache_secret_key -}} |
| 177 | {{- end -}} |
| 178 | |
| 179 | # glance |
| 180 | {{- if empty .Values.conf.manila.glance.auth_uri -}} |
| 181 | {{- $_ := set .Values.conf.manila.glance "auth_uri" $manila_auth_url -}} |
| 182 | {{- end -}} |
| 183 | |
| 184 | {{- if empty .Values.conf.manila.glance.auth_url -}} |
| 185 | {{- $_ := set .Values.conf.manila.glance "auth_url" $manila_auth_url -}} |
| 186 | {{- end -}} |
| 187 | |
| 188 | {{- if empty .Values.conf.manila.glance.region_name -}} |
| 189 | {{- $_ := set .Values.conf.manila.glance "region_name" .Values.endpoints.identity.auth.manila.region_name -}} |
| 190 | {{- end -}} |
| 191 | {{- if empty .Values.conf.manila.glance.project_name -}} |
| 192 | {{- $_ := set .Values.conf.manila.glance "project_name" $manila_project_name -}} |
| 193 | {{- end -}} |
| 194 | {{- if empty .Values.conf.manila.glance.project_domain_name -}} |
| 195 | {{- $_ := set .Values.conf.manila.glance "project_domain_name" $manila_project_domain_name -}} |
| 196 | {{- end -}} |
| 197 | {{- if empty .Values.conf.manila.glance.user_domain_name -}} |
| 198 | {{- $_ := set .Values.conf.manila.glance "user_domain_name" $manila_user_domain_name -}} |
| 199 | {{- end -}} |
| 200 | {{- if empty .Values.conf.manila.glance.username -}} |
| 201 | {{- $_ := set .Values.conf.manila.glance "username" $manila_username -}} |
| 202 | {{- end -}} |
| 203 | {{- if empty .Values.conf.manila.glance.password -}} |
| 204 | {{- $_ := set .Values.conf.manila.glance "password" $manila_password -}} |
| 205 | {{- end -}} |
| 206 | |
| 207 | {{- if empty .Values.conf.manila.glance.memcached_servers -}} |
| 208 | {{- $_ := set .Values.conf.manila.glance "memcached_servers" $memcached_servers -}} |
| 209 | {{- end -}} |
| 210 | {{- if empty .Values.conf.manila.glance.memcache_secret_key -}} |
| 211 | {{- $_ := set .Values.conf.manila.glance "memcache_secret_key" $memcache_secret_key -}} |
| 212 | {{- end -}} |
| 213 | |
Oleksandr Kozachenko | 103c85e | 2023-10-04 17:39:45 +0200 | [diff] [blame] | 214 | {{- if empty .Values.conf.manila_api_uwsgi.uwsgi.processes -}} |
| 215 | {{- $_ := set .Values.conf.manila_api_uwsgi.uwsgi "processes" .Values.conf.manila.DEFAULT.osapi_share_workers -}} |
| 216 | {{- end -}} |
| 217 | {{- if empty (index .Values.conf.manila_api_uwsgi.uwsgi "http-socket") -}} |
| 218 | {{- $http_socket_port := tuple "sharev2" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | toString }} |
| 219 | {{- $http_socket := printf "0.0.0.0:%s" $http_socket_port }} |
| 220 | {{- $_ := set .Values.conf.manila_api_uwsgi.uwsgi "http-socket" $http_socket -}} |
| 221 | {{- end -}} |
| 222 | |
okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [diff] [blame] | 223 | {{- if and (empty .Values.conf.logging.handler_fluent) (has "fluent" .Values.conf.logging.handlers.keys) -}} |
| 224 | {{- $fluentd_host := tuple "fluentd" "internal" $envAll | include "helm-toolkit.endpoints.hostname_namespaced_endpoint_lookup" }} |
| 225 | {{- $fluentd_port := tuple "fluentd" "internal" "service" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} |
| 226 | {{- $fluent_args := printf "('%s.%s', '%s', %s)" .Release.Namespace .Release.Name $fluentd_host $fluentd_port }} |
| 227 | {{- $handler_fluent := dict "class" "fluent.handler.FluentHandler" "formatter" "fluent" "args" $fluent_args -}} |
| 228 | {{- $_ := set .Values.conf.logging "handler_fluent" $handler_fluent -}} |
| 229 | {{- end -}} |
| 230 | |
| 231 | {{- if and (empty .Values.conf.logging.formatter_fluent) (has "fluent" .Values.conf.logging.formatters.keys) -}} |
| 232 | {{- $formatter_fluent := dict "class" "oslo_log.formatters.FluentFormatter" -}} |
| 233 | {{- $_ := set .Values.conf.logging "formatter_fluent" $formatter_fluent -}} |
| 234 | {{- end -}} |
| 235 | --- |
| 236 | apiVersion: v1 |
| 237 | kind: Secret |
| 238 | metadata: |
| 239 | name: manila-etc |
| 240 | type: Opaque |
| 241 | data: |
| 242 | rally_tests.yaml: {{ toYaml .Values.conf.rally_tests.tests | b64enc }} |
| 243 | manila.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.manila | b64enc }} |
Oleksandr Kozachenko | 103c85e | 2023-10-04 17:39:45 +0200 | [diff] [blame] | 244 | manila-api-uwsgi.ini: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.manila_api_uwsgi | b64enc }} |
okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [diff] [blame] | 245 | {{- range $key, $value := $envAll.Values.conf.rootwrap_filters }} |
| 246 | {{- $filePrefix := replace "_" "-" $key }} |
| 247 | {{ printf "%s.filters" $filePrefix }}: {{ $value.content | b64enc }} |
| 248 | {{- end }} |
| 249 | logging.conf: {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.logging | b64enc }} |
Rico Lin | 59516f6 | 2023-10-04 23:25:47 +0800 | [diff] [blame] | 250 | {{- if .Values.conf.paste }} |
okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [diff] [blame] | 251 | api-paste.ini: {{ include "helm-toolkit.utils.to_ini" .Values.conf.paste | b64enc }} |
Rico Lin | 59516f6 | 2023-10-04 23:25:47 +0800 | [diff] [blame] | 252 | {{- end }} |
okozachenko1203 | 61008f7 | 2023-03-23 21:21:09 +1100 | [diff] [blame] | 253 | policy.yaml: {{ toYaml .Values.conf.policy | b64enc }} |
| 254 | manila_sudoers: {{ $envAll.Values.conf.manila_sudoers | b64enc }} |
| 255 | rootwrap.conf: {{ $envAll.Values.conf.rootwrap | b64enc }} |
| 256 | {{- end }} |