Arthur Brenaut created AIRFLOW-3381:
---------------------------------------

             Summary: KubernetesPodOperator: Use secretKeyRef or 
configMapKeyRef in env_vars
                 Key: AIRFLOW-3381
                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3381
             Project: Apache Airflow
          Issue Type: Improvement
          Components: kubernetes
    Affects Versions: 1.10.0
            Reporter: Arthur Brenaut


The env_vars attribute of the KubernetesPodOperator allows to pass environment 
variables as string but it doesn't allows to pass a value from a configmap or a 
secret.

I'd like to be able to do
{code:java}
modeling = KubernetesPodOperator(
 ...
 env_vars={
  'MY_ENV_VAR': {
   'valueFrom': {
    'secretKeyRef': {
     'name': 'an-already-existing-secret',
     'key': 'key',
   }
  }
 },
 ...
)
{code}
Right now if I do that, Airflow generates the following config
{code:java}
- name: MY_ENV_VAR
  value:
   valueFrom:
    configMapKeyRef:
     name: an-already-existing-secret
     key: key
{code}
instead of 
{code:java}
- name: MY_ENV_VAR
  valueFrom:
   configMapKeyRef:
    name: an-already-existing-secret
    key: key
{code}
The _extract_env_and_secrets_ method of the _KubernetesRequestFactory_ could 
check if the value is a dictionary and use it directly.

 



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

Reply via email to