[
https://issues.apache.org/jira/browse/AIRFLOW-3381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarek Potiuk updated AIRFLOW-3381:
----------------------------------
Labels: gsoc gsoc2020 kubernetes mentor (was: kubernetes)
> 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: gsoc, gsoc2020, kubernetes, mentor
>
> 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.4#803005)