[ 
https://issues.apache.org/jira/browse/AIRFLOW-3347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16687005#comment-16687005
 ] 

Chris Bandy commented on AIRFLOW-3347:
--------------------------------------

I was able to track this down. The following in kubernetes_executor was always 
returning empty OrderedDict()

{code:python}
self.kube_secrets = configuration_dict.get('kubernetes_secrets', {})
{code}

The following line in AirflowConfigParser was not prepared for double 
underscores within/beneath a configuration section. Limiting the split seemed 
to do the trick.

{code:python}
diff --git a/airflow/configuration.py b/airflow/configuration.py
index 2e05fde0..4c923b80 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -358,7 +358,7 @@ class AirflowConfigParser(ConfigParser):
         # add env vars and overwrite because they have priority
         for ev in [ev for ev in os.environ if ev.startswith('AIRFLOW__')]:
             try:
-                _, section, key = ev.split('__')
+                _, section, key = ev.split('__', 2)
                 opt = self._get_env_var_option(section, key)
             except ValueError:
                 opt = None
{code}

> Unable to configure Kubernetes secrets through environment
> ----------------------------------------------------------
>
>                 Key: AIRFLOW-3347
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3347
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: configuration, kubernetes
>    Affects Versions: 1.10.0
>            Reporter: Chris Bandy
>            Priority: Major
>
> We configure Airflow through environment variables. While setting up the 
> Kubernetes Executor, we wanted to pass the SQL Alchemy connection string to 
> workers by including it the {{kubernetes_secrets}} section of config.
> Unfortunately, even with 
> {{AIRFLOW_\_KUBERNETES_SECRETS_\_AIRFLOW_\_CORE_\_SQL_ALCHEMY_CONN}} set in 
> the scheduler environment, the worker gets no environment secret environment 
> variables.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to