From 0c09a6dde2babe7939c9d3e921b4ffd5b60bf9f2 Mon Sep 17 00:00:00 2001 From: Maha Gamal Date: Sun, 22 Sep 2019 11:11:22 +0200 Subject: [PATCH] [stable/airflow]: Added extraInitContainers option (#15690) Signed-off-by: MahaGamal --- stable/airflow/Chart.yaml | 2 +- stable/airflow/README.md | 1 + stable/airflow/templates/deployments-scheduler.yaml | 6 ++++++ stable/airflow/values.yaml | 11 +++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/stable/airflow/Chart.yaml b/stable/airflow/Chart.yaml index 6d2bce2ac0..a45b08b78a 100644 --- a/stable/airflow/Chart.yaml +++ b/stable/airflow/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Airflow is a platform to programmatically author, schedule and monitor workflows name: airflow -version: 4.0.9 +version: 4.1.0 appVersion: 1.10.4 icon: https://airflow.apache.org/_images/pin_large.png home: https://airflow.apache.org/ diff --git a/stable/airflow/README.md b/stable/airflow/README.md index a15279dbc7..a1a0410dac 100644 --- a/stable/airflow/README.md +++ b/stable/airflow/README.md @@ -345,6 +345,7 @@ The following table lists the configurable parameters of the Airflow chart and t | `airflow.extraEnv` | specify additional environment variables to mount | `{}` | | `airflow.extraConfigmapMounts` | Additional configMap volume mounts on the airflow pods. | `[]` | | `airflow.podAnnotations` | annotations for scheduler, worker and web pods | `{}` | +| `airflow.extraInitContainers` | additional Init Containers to run in the scheduler pods | `[]` | | `airflow.extraContainers` | additional containers to run in the scheduler, worker & web pods | `[]` | | `airflow.extraVolumeMounts` | additional volumeMounts to the main container in scheduler, worker & web pods | `[]`| | `airflow.extraVolumes` | additional volumes for the scheduler, worker & web pods | `[]` | diff --git a/stable/airflow/templates/deployments-scheduler.yaml b/stable/airflow/templates/deployments-scheduler.yaml index 63c83956c3..29de40d801 100644 --- a/stable/airflow/templates/deployments-scheduler.yaml +++ b/stable/airflow/templates/deployments-scheduler.yaml @@ -77,6 +77,12 @@ spec: mountPath: /keys {{- end }} {{- end }} +{{- if and ( .Values.airflow.extraInitContainers ) ( .Values.dags.initContainer.enabled ) }} +{{ toYaml .Values.airflow.extraInitContainers | indent 8 }} +{{- else if and ( .Values.airflow.extraInitContainers ) ( not .Values.dags.initContainer.enabled ) }} + initContainers: +{{ toYaml .Values.airflow.extraInitContainers | indent 8 }} +{{- end }} containers: - name: {{ .Chart.Name }}-scheduler image: {{ .Values.airflow.image.repository }}:{{ .Values.airflow.image.tag }} diff --git a/stable/airflow/values.yaml b/stable/airflow/values.yaml index acfea2a437..b0b9ae9fa3 100644 --- a/stable/airflow/values.yaml +++ b/stable/airflow/values.yaml @@ -137,6 +137,17 @@ airflow: podAnnotations: {} ## Example: ## iam.amazonaws.com/role: airflow-Role + + extraInitContainers: [] + ## Additional init containers to run before the Scheduler pods. + ## for example, be used to run a sidecar that chown Logs storage . + # - name: volume-mount-hack + # image: busybox + # command: ["sh", "-c", "chown -R 1000:1000 logs"] + # volumeMounts: + # - mountPath: /usr/local/airflow/logs + # name: logs-data + extraContainers: [] ## Additional containers to run alongside the Scheduler, Worker and Web pods ## This could, for example, be used to run a sidecar that syncs DAGs from object storage.