diff --git a/charts/airflow/Chart.yaml b/charts/airflow/Chart.yaml index 78b3c85c..a899ba53 100644 --- a/charts/airflow/Chart.yaml +++ b/charts/airflow/Chart.yaml @@ -1,15 +1,15 @@ apiVersion: v1 description: airflow is a platform to programmatically author, schedule, and monitor workflows name: airflow -version: 8.0.0 +version: 8.0.1 appVersion: 2.0.1 icon: https://airflow.apache.org/_images/pin_large.png home: https://airflow.apache.org/ maintainers: - - name: gsemet - url: https://github.com/gsemet - name: thesuperzapper url: https://github.com/thesuperzapper + - name: gsemet + url: https://github.com/gsemet sources: - https://github.com/airflow-helm/charts/tree/main/charts/airflow keywords: diff --git a/charts/airflow/README.md b/charts/airflow/README.md index 2e148705..76b2294e 100644 --- a/charts/airflow/README.md +++ b/charts/airflow/README.md @@ -394,7 +394,7 @@ web: webserverConfig: stringOverride: |- from airflow import configuration as conf - from flask_appbuilder.security.manager import AUTH_LDAP + from flask_appbuilder.security.manager import AUTH_OAUTH SQLALCHEMY_DATABASE_URI = conf.get('core', 'SQL_ALCHEMY_CONN') diff --git a/charts/airflow/ci/default-values.yaml b/charts/airflow/ci/default-values.yaml new file mode 100644 index 00000000..ffe10f5c --- /dev/null +++ b/charts/airflow/ci/default-values.yaml @@ -0,0 +1,2 @@ +## must be enable because `--wait` is always passed by chart-testing +helmWait: true diff --git a/charts/airflow/files/pod_template.kubernetes-helm-yaml b/charts/airflow/files/pod_template.kubernetes-helm-yaml index 12dd5fe2..2d4ae669 100644 --- a/charts/airflow/files/pod_template.kubernetes-helm-yaml +++ b/charts/airflow/files/pod_template.kubernetes-helm-yaml @@ -55,11 +55,11 @@ spec: {{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }} {{- if $volumeMounts }} volumeMounts: - {{- $volumeMounts | indent 8 }} + {{- $volumeMounts | nindent 8 }} {{- end }} {{- $extraVolumes := .Values.airflow.kubernetesPodTemplate.extraVolumes }} {{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }} {{- if $volumes }} volumes: - {{- $volumes | indent 4 }} + {{- $volumes | nindent 4 }} {{- end }} diff --git a/charts/airflow/templates/_helpers/validate-values.tpl b/charts/airflow/templates/_helpers/validate-values.tpl index 2a082212..6f9e3de8 100644 --- a/charts/airflow/templates/_helpers/validate-values.tpl +++ b/charts/airflow/templates/_helpers/validate-values.tpl @@ -15,18 +15,18 @@ {{ required "The `airflow.executor` must be one of: [CeleryExecutor, CeleryKubernetesExecutor, KubernetesExecutor]!" nil }} {{- end }} {{- if eq .Values.airflow.executor "CeleryExecutor" }} - {{- if or (not .Values.workers.enabled) (not .Values.redis.enabled) }} - {{ required "If `airflow.executor=CeleryExecutor`, all of [`workers.enabled`, `redis.enabled`] should be `true`!" nil }} + {{- if not .Values.workers.enabled }} + {{ required "If `airflow.executor=CeleryExecutor`, then `workers.enabled` should be `true`!" nil }} {{- end }} {{- end }} {{- if eq .Values.airflow.executor "CeleryKubernetesExecutor" }} - {{- if or (not .Values.workers.enabled) (not .Values.redis.enabled) }} - {{ required "If `airflow.executor=CeleryKubernetesExecutor`, all of [`workers.enabled`, `redis.enabled`] should be `true`!" nil }} + {{- if not .Values.workers.enabled }} + {{ required "If `airflow.executor=CeleryKubernetesExecutor`, then `workers.enabled` should be `true`!" nil }} {{- end }} {{- end }} {{- if eq .Values.airflow.executor "KubernetesExecutor" }} {{- if or (.Values.workers.enabled) (.Values.flower.enabled) (.Values.redis.enabled) }} - {{ required "If `airflow.executor=KubernetesExecutor`, none of [`workers.enabled`, `flower.enabled`, `redis.enabled`] should be `true`!" nil }} + {{ required "If `airflow.executor=KubernetesExecutor`, then all of [`workers.enabled`, `flower.enabled`, `redis.enabled`] should be `false`!" nil }} {{- end }} {{- end }} diff --git a/charts/airflow/templates/config/configmap-pod-template.yaml b/charts/airflow/templates/config/configmap-pod-template.yaml index 5b2dbe2e..186f1779 100644 --- a/charts/airflow/templates/config/configmap-pod-template.yaml +++ b/charts/airflow/templates/config/configmap-pod-template.yaml @@ -13,6 +13,6 @@ data: {{- if .Values.airflow.kubernetesPodTemplate.stringOverride }} {{- .Values.airflow.kubernetesPodTemplate.stringOverride | nindent 4 }} {{- else }} - {{- tpl (.Files.Get "files/pod_template.kubernetes-helm-yaml") . | indent 4 }} + {{- tpl (.Files.Get "files/pod_template.kubernetes-helm-yaml") . | nindent 4 }} {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/airflow/templates/flower/flower-deployment.yaml b/charts/airflow/templates/flower/flower-deployment.yaml index c9e23052..83cd0063 100644 --- a/charts/airflow/templates/flower/flower-deployment.yaml +++ b/charts/airflow/templates/flower/flower-deployment.yaml @@ -154,12 +154,12 @@ spec: {{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }} {{- if $volumeMounts }} volumeMounts: - {{- $volumeMounts | indent 12 }} + {{- $volumeMounts | nindent 12 }} {{- end }} {{- $extraVolumes := .Values.flower.extraVolumes }} {{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }} {{- if $volumes }} volumes: - {{- $volumes | indent 8 }} + {{- $volumes | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/airflow/templates/jobs/job-upgrade-db.yaml b/charts/airflow/templates/jobs/job-upgrade-db.yaml index eeb780ee..e7fce3cc 100644 --- a/charts/airflow/templates/jobs/job-upgrade-db.yaml +++ b/charts/airflow/templates/jobs/job-upgrade-db.yaml @@ -2,9 +2,15 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "airflow.fullname" . }}-upgrade-db - ## this job can't be a post-install hook, because this job must run BEFORE other - ## resource can become ready, meaning if you use the --wait flag the install would - ## never finish (which is important because chart-testing uses --wait) + {{- /* this job can't be a post-install hook if `--wait` is passed to helm, */ -}} + {{- /* because this job must run BEFORE other resource can become ready, */ -}} + {{- /* meaning the install would never finish */ -}} + {{- if not .Values.helmWait }} + annotations: + helm.sh/hook: post-install,post-upgrade + helm.sh/hook-weight: "-10" + helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded + {{- end }} labels: app: {{ include "airflow.labels.app" . }} component: jobs diff --git a/charts/airflow/templates/scheduler/scheduler-deployment.yaml b/charts/airflow/templates/scheduler/scheduler-deployment.yaml index 95b55a67..30ea910b 100644 --- a/charts/airflow/templates/scheduler/scheduler-deployment.yaml +++ b/charts/airflow/templates/scheduler/scheduler-deployment.yaml @@ -141,7 +141,7 @@ spec: {{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }} {{- if or ($volumeMounts) (include "airflow.executor.kubernetes_like" .) }} volumeMounts: - {{- $volumeMounts | indent 12 }} + {{- $volumeMounts | nindent 12 }} {{- if include "airflow.executor.kubernetes_like" . }} - name: pod-template mountPath: /opt/airflow/pod_templates/pod_template.yaml @@ -159,7 +159,7 @@ spec: {{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }} {{- if or ($volumes) (include "airflow.executor.kubernetes_like" .) }} volumes: - {{- $volumes | indent 8 }} + {{- $volumes | nindent 8 }} {{- if include "airflow.executor.kubernetes_like" . }} - name: pod-template configMap: diff --git a/charts/airflow/templates/webserver/webserver-deployment.yaml b/charts/airflow/templates/webserver/webserver-deployment.yaml index 5b837c03..6451af97 100644 --- a/charts/airflow/templates/webserver/webserver-deployment.yaml +++ b/charts/airflow/templates/webserver/webserver-deployment.yaml @@ -128,7 +128,7 @@ spec: {{- $extraVolumeMounts := .Values.web.extraVolumeMounts }} {{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }} volumeMounts: - {{- $volumeMounts | indent 12 }} + {{- $volumeMounts | nindent 12 }} - name: webserver-config mountPath: /opt/airflow/webserver_config.py subPath: webserver_config.py @@ -137,12 +137,12 @@ spec: {{- include "airflow.container.git_sync" . | indent 8 }} {{- end }} {{- if .Values.airflow.extraContainers }} - {{- toYaml .Values.airflow.extraContainers | indent 8 }} + {{- toYaml .Values.airflow.extraContainers | nindent 8 }} {{- end }} {{- $extraVolumes := .Values.web.extraVolumes }} {{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }} volumes: - {{- $volumes | indent 8 }} + {{- $volumes | nindent 8 }} - name: webserver-config secret: {{- if .Values.web.webserverConfig.existingSecret }} diff --git a/charts/airflow/templates/worker/worker-statefulset.yaml b/charts/airflow/templates/worker/worker-statefulset.yaml index b1e3cabf..13081659 100644 --- a/charts/airflow/templates/worker/worker-statefulset.yaml +++ b/charts/airflow/templates/worker/worker-statefulset.yaml @@ -158,7 +158,7 @@ spec: {{- $volumeMounts := include "airflow.volumeMounts" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumeMounts" $extraVolumeMounts) }} {{- if $volumeMounts }} volumeMounts: - {{- $volumeMounts | indent 12 }} + {{- $volumeMounts | nindent 12 }} {{- end }} {{- if .Values.dags.gitSync.enabled }} {{- include "airflow.container.git_sync" . | indent 8 }} @@ -170,6 +170,6 @@ spec: {{- $volumes := include "airflow.volumes" (dict "Values" .Values "extraPipPackages" $extraPipPackages "extraVolumes" $extraVolumes) }} {{- if $volumes }} volumes: - {{- $volumes | indent 8 }} + {{- $volumes | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/airflow/values.yaml b/charts/airflow/values.yaml index 6c860995..d7c13d89 100644 --- a/charts/airflow/values.yaml +++ b/charts/airflow/values.yaml @@ -1,3 +1,7 @@ +## enable this value if you pass `--wait` to your `helm install` +## +helmWait: false + ################################### # Airflow - Common Configs ################################### diff --git a/ct-config.yaml b/ct-config.yaml index f856f0be..def8873b 100644 --- a/ct-config.yaml +++ b/ct-config.yaml @@ -4,4 +4,4 @@ chart-dirs: - charts chart-repos: - stable=https://charts.helm.sh/stable -helm-extra-args: --timeout=600s \ No newline at end of file +helm-extra-args: --timeout=900s