Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow disabling chart-managed webserver_config.py #631

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: allow webserver_config.py to come from the image
Where you have a webserver_config.py that comes on the image you're using, there needs to be a way to turn it off

Signed-off-by: Matthew Byng-Maddick <mbyng-maddick@olx.com>
Matthew Byng-Maddick committed Aug 19, 2022
commit 07e5bba4668cf4a78ac6b7e0f232c7e40b01beee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if not .Values.web.webserverConfig.existingSecret }}
{{- if (and .Values.web.webserverConfig.enabled (not .Values.web.webserverConfig.existingSecret)) }}
apiVersion: v1
kind: Secret
metadata:
Original file line number Diff line number Diff line change
@@ -42,7 +42,9 @@ spec:
annotations:
checksum/secret-config-envs: {{ include (print $.Template.BasePath "/config/secret-config-envs.yaml") . | sha256sum }}
checksum/secret-local-settings: {{ include (print $.Template.BasePath "/config/secret-local-settings.yaml") . | sha256sum }}
{{- if .Values.web.webserverConfig.enabled }}
checksum/config-webserver-config: {{ include (print $.Template.BasePath "/config/secret-webserver-config.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.airflow.podAnnotations }}
{{- toYaml .Values.airflow.podAnnotations | nindent 8 }}
{{- end }}
@@ -136,10 +138,12 @@ spec:
{{- end }}
volumeMounts:
{{- $volumeMounts | indent 12 }}
{{- if .Values.web.webserverConfig.enabled }}
- name: webserver-config
mountPath: /opt/airflow/webserver_config.py
subPath: webserver_config.py
readOnly: true
{{- end }}
{{- if .Values.dags.gitSync.enabled }}
{{- include "airflow.container.git_sync" . | indent 8 }}
{{- end }}
@@ -148,11 +152,13 @@ spec:
{{- end }}
volumes:
{{- $volumes | indent 8 }}
{{- if .Values.web.webserverConfig.enabled }}
- name: webserver-config
secret:
{{- if .Values.web.webserverConfig.existingSecret }}
secretName: {{ .Values.web.webserverConfig.existingSecret }}
{{- else }}
secretName: {{ include "airflow.fullname" . }}-webserver-config
{{- end }}
defaultMode: 0644
defaultMode: 0644
{{- end }}
4 changes: 4 additions & 0 deletions charts/airflow/values.yaml
Original file line number Diff line number Diff line change
@@ -664,6 +664,10 @@ web:
########################################
##
webserverConfig:
## by default, the helm chart owns the webserver config, however, sometimes it may be on a
## custom version of the image. If this is the case, set this to false
enabled: true

## the full content of the `webserver_config.py` file (as a string)
## - docs for Flask-AppBuilder security configs:
## https://flask-appbuilder.readthedocs.io/en/latest/security.html