Replies: 1 comment
-
|
As dicussed in the original discussion - draft PR with POC would be nice to make the discussion concrete. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
During the review of #58293, a discussion came up around how the Airflow webserver Flask application is configured. At the moment, Flask-specific settings/behaviour are mainly provided through
webserver_config.py.This discussion is intended as a follow-up to explore whether Airflow should optionally support a second way of configuring some Flask app settings, using prefixed environment variables via app.config.from_prefixed_env() (Flask-Limiter also honors Flask’s configuration values.).
Motivation
Using
app.config.from_prefixed_env()would allow selected Flask configuration options to be provided via environment variables, for example:This approach can be useful not only in the Airflow Helm chart, but more generally in declarative deployments where configuration is defined via environment variables and overridden per environment without changing Python files. It can also help avoid introducing imperative logic or environment-specific conditionals in code, which can make it harder to understand which configuration applies in a given setup. In addition, sensitive parts of the configuration can be managed separately using secrets.
At the same time, this is a proposal, and some users may not see additional value if their current setup already meets their needs.
Proposal
Allow the webserver to optionally load some Flask configuration values from environment variables using
app.config.from_prefixed_env(), with a clear prefix such asAIRFLOW__FAB__, or even a more specific namespace (e.g.AIRFLOW__FAB__FLASK_SETTINGS,AIRFLOW__FAB__FLASK_CONFIG,AIRFLOW__FAB__CONFIG).This mechanism would not replace
webserver_config.py, which would continue to be the primary configuration mechanism. When both approaches are used,webserver_config.pywould have precedence over environment-based configuration.POC PR: #60073
Beta Was this translation helpful? Give feedback.
All reactions