From 0523fbf0047816c56acb50ee13c2cd06cc38f9fe Mon Sep 17 00:00:00 2001 From: Shintaro Murakami Date: Wed, 4 Jul 2018 17:48:51 +0100 Subject: [PATCH] [AIRFLOW-2655] Fix inconsistency of default config of kubernetes worker Closes #3529 from mrkm4ntr/airflow-2655 --- airflow/contrib/kubernetes/worker_configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow/contrib/kubernetes/worker_configuration.py b/airflow/contrib/kubernetes/worker_configuration.py index 4abeba2526..51b51e8e7f 100644 --- a/airflow/contrib/kubernetes/worker_configuration.py +++ b/airflow/contrib/kubernetes/worker_configuration.py @@ -19,6 +19,7 @@ import copy import os import six +from airflow.configuration import conf from airflow.contrib.kubernetes.pod import Pod, Resources from airflow.contrib.kubernetes.secret import Secret from airflow.utils.log.logging_mixin import LoggingMixin @@ -81,7 +82,8 @@ class WorkerConfiguration(LoggingMixin): """Defines any necessary environment variables for the pod executor""" env = { 'AIRFLOW__CORE__DAGS_FOLDER': '/tmp/dags', - 'AIRFLOW__CORE__EXECUTOR': 'LocalExecutor' + 'AIRFLOW__CORE__EXECUTOR': 'LocalExecutor', + 'AIRFLOW__CORE__SQL_ALCHEMY_CONN': conf.get('core', 'SQL_ALCHEMY_CONN') } if self.kube_config.airflow_configmap: env['AIRFLOW__CORE__AIRFLOW_HOME'] = self.worker_airflow_home