Enable setting the base url of the website#9778
Conversation
Take into account the path of the base url in liveness and readiness check probes. This introduces `baseUrl` as a value to use for the chart's health checks and also to use to set the AIRFLOW__WEBSERVER__BASE_URL environment variable.
|
LGTM But would love @dimberman to take a look |
|
Why would the liveness and readiness probes need a base URL? Aren't those directly performed within the pod already? |
|
I think this is in the case where Airflow is run behind a reverse proxy. https://airflow.readthedocs.io/en/stable/howto/run-behind-proxy.html As in an example, if the proxy is configured to serve airflow from What I notice without it is, when |
|
I notice without a base_url set, the healthchecks |
|
@vsimon I guess I'm a bit confused here, wouldn't that be testing the reverse proxy instead of airflow? Why would you need to access airflow via the reverse proxy for a health check? |
|
@dimberman The base_url option adds a prefix to each address (including health check), so this change looks good. This option is implemented as WSGI middleware, so it affects all addresses. This option is not related to reverse proxy, but is often used together. We have a similar option - proxy_fix and it is closely related to the option and has a similar purpose, but a different way of working. |
So localhost:airflowport/health wont work if base_url is set? If that's the case may be the webserver should be tweaked to make sure that the healthcheck url is excluded from this prefixing? I think it doesn't make sense to set the probes on the reverse proxy url. Probes are a way for kubernetes to check if that specific pod-container is healthy, the reverse proxied health url doesn't give that information |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
@vsimon , I'm facing this exact issue currently. Since this PR is not merged, is there some way to handle this issue for now? TIA! |
|
hi @gowtamchandrahasa The way I handled it was within the helm chart. I happen to be using chart version: 7.16.0. Assuming I have a dns name (the hostname of the reverse proxy) and a path (the path configured in the reverse proxy to map to the airflow web serevice) I set these two fields: |
Take into account the path of the base url in liveness and readiness
check probes.
This introduces
baseUrlas a value to use for the chart's healthchecks and also to use to set the AIRFLOW__WEBSERVER__BASE_URL
environment variable.
Fixes #9777
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.