You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/07/14 11:27:05 UTC
[GitHub] [airflow] aneesh-joseph commented on pull request #9816: Helm chart can now place arbitrary config settings in to airflow.cfg
aneesh-joseph commented on pull request #9816:
URL: https://github.com/apache/airflow/pull/9816#issuecomment-658126694
totally worth it as this will let us drive other parts of the chart from this config - like say do not use dag side cars if dag serialization is turned on :)
I used a slightly different approach to set defaults and render our internal charts.
small snippet of our defaults from `values.yaml`
```
airflow_cfg:
kubernetes:
namespace: "{{ .Release.Namespace }}"
airflow_configmap: "{{ .Release.Name }}"
airflow_local_settings_configmap: "{{ .Release.Name }}"
worker_service_account_name: "{{ .Release.Name }}-sa"
secrets:
backend: 'airflow.providers.hashicorp.secrets.vault.VaultBackend'
backend_kwargs: '{"connections_path": "{{ include "base_secret_path" . }}/connections", "variables_path": "{{ include "base_secret_path" . }}/variables", "url": "{{ include "vaultAddr" . }}", "auth_type": "kubernetes","kubernetes_role": "{{ .Values.kubernetes_role }}","namespace":"{{ .Values.vault_ns }}","auth_mount_point": "{{ .Values.vault_auth_mount }}"}'
```
and I then render it in the configmap using
```
airflow.cfg: |-
{{- $root := . -}}
{{- range $airflow_config_header, $config_dict := .Values.airflow_cfg }}
[{{ $airflow_config_header }}]
{{- range $key, $val := $config_dict }}
{{ $key }} = {{ tpl ($val | toString) $root }}
{{- end}}
{{- end}}
```
This will render all the default config keys, but the config values can be templated for these defaults
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org