diff --git a/horizon/Chart.yaml b/horizon/Chart.yaml index b75dca05cd..a7c9070b38 100644 --- a/horizon/Chart.yaml +++ b/horizon/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Horizon name: horizon -version: 0.2.14 +version: 0.2.15 home: https://docs.openstack.org/horizon/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Horizon/OpenStack_Project_Horizon_vertical.png sources: diff --git a/horizon/templates/bin/_horizon.sh.tpl b/horizon/templates/bin/_horizon.sh.tpl index 712f57ae60..8e675529d2 100644 --- a/horizon/templates/bin/_horizon.sh.tpl +++ b/horizon/templates/bin/_horizon.sh.tpl @@ -22,6 +22,9 @@ function start () { rm -f ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/local_settings.py ln -s /etc/openstack-dashboard/local_settings ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/local_settings.py ln -s ${SITE_PACKAGES_ROOT}/openstack_dashboard/conf/default_policies /etc/openstack-dashboard/default_policies + {{- range $key, $value := .Values.conf.horizon.local_settings_d }} + ln -s /etc/openstack-dashboard/local_settings.d/{{ $key }}.py ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/local_settings.d/{{ $key }}.py + {{- end }} # wsgi/horizon-http needs open files here, including secret_key_store chown -R horizon ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/ diff --git a/horizon/templates/configmap-etc.yaml b/horizon/templates/configmap-etc.yaml index 0d2114222b..d02cf2ba8d 100644 --- a/horizon/templates/configmap-etc.yaml +++ b/horizon/templates/configmap-etc.yaml @@ -32,4 +32,7 @@ data: {{- range $key, $value := .Values.conf.horizon.policy }} {{ printf "%s_policy.yaml" $key }}: {{ toYaml $value | b64enc }} {{- end }} +{{- range $key, $value := .Values.conf.horizon.local_settings_d }} + {{ printf "%s.py" $key }}: {{ $value | b64enc }} +{{- end }} {{- end }} diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index 1922423fc8..dd20a76f94 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -136,6 +136,13 @@ spec: subPath: {{ base $policyJsonFile }} readOnly: true {{- end }} + {{- range $key, $value := $envAll.Values.conf.horizon.local_settings_d }} + {{- $localSettingsFile := printf "/etc/openstack-dashboard/local_settings.d/%s.py" $key }} + - name: horizon-etc + mountPath: {{ $localSettingsFile }} + subPath: {{ base $localSettingsFile }} + readOnly: true + {{- end }} {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.secrets.tls.dashboard.dashboard.internal "path" "/etc/openstack-dashboard/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} {{ if $mounts_horizon.volumeMounts }}{{ toYaml $mounts_horizon.volumeMounts | indent 12 }}{{ end }} diff --git a/horizon/values.yaml b/horizon/values.yaml index e618b89fd4..1ea0aa8aaa 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -177,6 +177,14 @@ conf: # site as frames. This defends against clickjacking attacks. # Requires mod_headers to be enabled. # + local_settings_d: {} + ## For example, _50_monasca_ui_settings.py + # _50_monasca_ui_settings: | + # from django.conf import settings + # # Grafana button titles/file names (global across all projects): + # GRAFANA_LINKS = [] + # DASHBOARDS = getattr(settings, 'GRAFANA_LINKS', GRAFANA_LINKS) + local_settings: config: # Use "True" and "False" as Titlecase strings with quotes, boolean diff --git a/releasenotes/notes/horizon.yaml b/releasenotes/notes/horizon.yaml index 8b36de8514..7f78891f01 100644 --- a/releasenotes/notes/horizon.yaml +++ b/releasenotes/notes/horizon.yaml @@ -24,4 +24,5 @@ horizon: - 0.2.12 Support both json and yaml RBAC Policy Format - 0.2.13 Add container infra api version in values - 0.2.14 Add OPENSTACK_ENDPOINT_TYPE value + - 0.2.15 Add local_settings.d ...