Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions charts/airflow/docs/faq/configuration/airflow-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ web:
## the name of an existing Secret containing a `webserver_config.py` key
## NOTE: if set, takes precedence over `web.webserverConfig.stringOverride`
#existingSecret: "my-airflow-webserver-config"

## if the `webserver_config.py` file is mounted
## NOTE: set to false if you wish to mount your own `webserver_config.py` file
#enabled: false
```

> 🟦 __Tip__ 🟦
Expand Down
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 and (.Values.web.webserverConfig.enabled) (not .Values.web.webserverConfig.existingSecret) }}
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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
5 changes: 5 additions & 0 deletions charts/airflow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@ web:
########################################
##
webserverConfig:
## if the `webserver_config.py` file is mounted
## - set to false if you wish to mount your own `webserver_config.py` file
##
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
Expand Down