You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/11 16:28:01 UTC

[jira] [Commented] (AIRFLOW-3381) KubernetesPodOperator: Use secretKeyRef or configMapKeyRef in env_vars

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

ASF GitHub Bot commented on AIRFLOW-3381:
-----------------------------------------

stale[bot] commented on pull request #4221: [AIRFLOW-3381] Allow use of secretKeyRef or configMapKeyRef in env_vars
URL: https://github.com/apache/airflow/pull/4221
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> 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: operators
>    Affects Versions: 1.10.0
>            Reporter: Arthur Brenaut
>            Priority: Major
>              Labels: kubernetes
>
> 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
(v8.3.2#803003)