[
https://issues.apache.org/jira/browse/AIRFLOW-6260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16998693#comment-16998693
]
ASF subversion and git services commented on AIRFLOW-6260:
----------------------------------------------------------
Commit ce9c6ec43cdb3871d5e86ea9386b49c2812c6d37 in airflow's branch
refs/heads/v1-10-test from Noël Bardelot
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=ce9c6ec ]
[AIRFLOW-6260] Drive _cmd config option by env var (#6801)
This improves the ability to configure AirFlow
using Kubernetes best practices. You can provide
for exemple AIRFLOW__CORE__SQL_ALCHEMY_CONN_CMD
referencing a shell script that computes the
connection string using Kubernetes secrets.
And that script can be provided to the container
using a configmap.
Adding a unit test to check that an option that
should NOT be overriden by a command is correctly
only read from the configuration.
(cherry picked from commit b3e847086a5bf6d6ad729a043ac64470174cd011)
> Drive _cmd config options by env var
> -------------------------------------
>
> Key: AIRFLOW-6260
> URL: https://issues.apache.org/jira/browse/AIRFLOW-6260
> Project: Apache Airflow
> Issue Type: Improvement
> Components: configuration
> Affects Versions: 1.10.6
> Reporter: Noël BARDELOT
> Assignee: Noël BARDELOT
> Priority: Minor
> Fix For: 1.10.7
>
>
> Add the ability to provide _CMD environment variables the same way you can
> use _cmd options in the configuration. Those _CMD environment variable would
> have priority against the _cmd options the same way the usual environment
> variables have priority against the configuration options.
> The goal is to allow Kubernetes users to provide such commands via configmap,
> and reference them in the configuration using environment variables. The
> referenced script would itself consume secrets in order to construct the
> connection.
> For exemple a script provided as a configmap and referenced by
> AIRFLOW_CORE_SQL_ALCHEMY_CONN_CMD would compute the Alchemy connection using
> the database user and password provided as secrets:
> {{ }}
> {{#!/bin/bash}}
> {{echo -n "postgresql+psycopg2://`cat
> /var/run/secrets/postgresql/postgresql-user`:`cat
> /var/run/secrets/postgresql/postgresql-password`@$POSTGRESQL_SERVICE_HOST:$POSTGRESQL_SERVICE_PORT/airflow"}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)