diff --git a/horizon/templates/bin/_horizon.sh.tpl b/horizon/templates/bin/_horizon.sh.tpl index dec000f3e2..4dbfc0eede 100644 --- a/horizon/templates/bin/_horizon.sh.tpl +++ b/horizon/templates/bin/_horizon.sh.tpl @@ -27,8 +27,17 @@ function start () { # wsgi/horizon-http needs open files here, including secret_key_store chown -R horizon ${SITE_PACKAGES_ROOT}/openstack_dashboard/local/ - a2enmod rewrite - a2dismod status + {{- if .Values.conf.software.apache2.a2enmod }} + {{- range .Values.conf.software.apache2.a2enmod }} + a2enmod {{ . }} + {{- end }} + {{- end }} + + {{- if .Values.conf.software.apache2.a2dismod }} + {{- range .Values.conf.software.apache2.a2dismod }} + a2dismod {{ . }} + {{- end }} + {{- end }} if [ -f /etc/apache2/envvars ]; then # Loading Apache2 ENV variables @@ -53,11 +62,11 @@ function start () { /tmp/manage.py compress --force rm -rf /tmp/_tmp_.secret_key_store.lock /tmp/.secret_key_store - exec apache2 -DFOREGROUND + exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }} } function stop () { - apachectl -k graceful-stop + {{ .Values.conf.software.apache2.binary }} -k graceful-stop } $COMMAND diff --git a/horizon/templates/deployment.yaml b/horizon/templates/deployment.yaml index d0531c4fa6..3baf1e294c 100644 --- a/horizon/templates/deployment.yaml +++ b/horizon/templates/deployment.yaml @@ -101,12 +101,12 @@ spec: subPath: manage.py readOnly: true - name: horizon-etc - mountPath: /etc/apache2/sites-enabled/000-default.conf + mountPath: {{ .Values.conf.software.apache2.site_dir }}/000-default.conf subPath: horizon.conf readOnly: true {{- if .Values.conf.horizon.security }} - name: horizon-etc - mountPath: /etc/apache2/conf-available/security.conf + mountPath: {{ .Values.conf.software.apache2.conf_dir }}/security.conf subPath: security.conf readOnly: true {{- end }} diff --git a/horizon/values.yaml b/horizon/values.yaml index 31ace979ca..e4f8c28320 100644 --- a/horizon/values.yaml +++ b/horizon/values.yaml @@ -57,6 +57,17 @@ network: port: 31000 conf: + software: + apache2: + binary: apache2 + start_parameters: -DFOREGROUND + site_dir: /etc/apache2/sites-enable + conf_dir: /etc/apache2/conf-enabled + mods_dir: /etc/apache2/mods-available + a2enmod: + - rewrite + a2dismod: + - status horizon: apache: | Listen 0.0.0.0:{{ tuple "dashboard" "internal" "web" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}