From 2175e4af3eb0c1b42cc20eae0a513fafbcc22e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arthur=20Cl=C3=A9ment?= Date: Fri, 22 Nov 2019 14:21:28 +0100 Subject: [PATCH] [stable/airflow] Unlink web & flower UI config from ingress config (#19074) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Arthur Clément --- stable/airflow/Chart.yaml | 2 +- stable/airflow/README.md | 15 +++++++++++++-- stable/airflow/templates/configmap-env.yaml | 4 ++-- stable/airflow/values.yaml | 16 ++++++++++++---- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/stable/airflow/Chart.yaml b/stable/airflow/Chart.yaml index c29a7841ff..01db047212 100644 --- a/stable/airflow/Chart.yaml +++ b/stable/airflow/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Airflow is a platform to programmatically author, schedule and monitor workflows name: airflow -version: 4.10.0 +version: 5.0.0 appVersion: 1.10.4 icon: https://airflow.apache.org/_images/pin_large.png home: https://airflow.apache.org/ diff --git a/stable/airflow/README.md b/stable/airflow/README.md index 5b86d6d5e9..ad14b53c32 100644 --- a/stable/airflow/README.md +++ b/stable/airflow/README.md @@ -69,12 +69,12 @@ image. Please also note that the Airflow UI and Flower do not behave the same: - Airflow Web UI behaves transparently, to configure it one just needs to specify the - `ingress.web.path` value. + `web.baseUrl` value. Ingress can be configured with `ingress.web.host` and `ingress.web.path`. - Flower cannot handle this scheme directly and requires a URL rewrite mechanism in front of it. In short, it is able to generate the right URLs in the returned HTML file but cannot respond to these URL. It is commonly found in software that wasn't intended to work under something else than a root URL or localhost port. To use it, see the `values.yaml` for how - to configure your ingress controller to rewrite the URL (or "strip" the prefix path). + to configure your ingress controller to rewrite the URL (or "strip" the prefix path) and `flower.urlPrefix`. Note: unreleased Flower (as of June 2018) does not need the prefix strip feature anymore. It is integrated in `docker-airflow-dev:2.0dev` image. @@ -380,12 +380,14 @@ The following table lists the configurable parameters of the Airflow chart and t | `airflow.extraVolumeMounts` | additional volumeMounts to the main container in scheduler, worker & web pods | `[]`| | `airflow.extraVolumes` | additional volumes for the scheduler, worker & web pods | `[]` | | `airflow.initdb` | run `airflow initdb` when starting the scheduler | `true` | +| `flower.urlPrefix` | path of the flower ui | "" | | `flower.resources` | custom resource configuration for flower pod | `{}` | | `flower.labels` | labels for the flower deployment | `{}` | | `flower.annotations` | annotations for the flower deployment | `{}` | | `flower.service.type` | service type for Flower UI | `ClusterIP` | | `flower.service.annotations` | (optional) service annotations for Flower UI | `{}` | | `flower.service.externalPort` | (optional) external port for Flower UI | `5555` | +| `web.baseUrl` | webserver UI URL | `http://localhost:8080` | | `web.resources` | custom resource configuration for web pod | `{}` | | `web.labels` | labels for the web deployment | `{}` | | `web.annotations` | annotations for the web deployment | `{}` | @@ -491,6 +493,15 @@ Full and up-to-date documentation can be found in the comments of the `values.ya ## Upgrading +### To 5.0.0 +This version splits the configuration for webserver and flower web UI from ingress configurations for separation of concerns. + +Two new parameters: + - `web.baseUrl` + - `flower.urlPrefix` + +This upgrade will fail if a custom ingress path is set for web and/or flower and `web.baseUrl` and/or `flower.urlPrefix` + ### To 4.0.0 This version splits the specs for the NodeSelector, Affinity and Toleration features. Instead of being global, and injected in every component, they are now defined _by component_ to provide more flexibility for your deployments. As such, the migration steps are really simple. Just copy and paste your node/affinity/tolerance definitions in the four airflow components, which are `worker`, `scheduler`, `flower` and `web`. The default values file should help you with locating those. diff --git a/stable/airflow/templates/configmap-env.yaml b/stable/airflow/templates/configmap-env.yaml index fbd132ce4c..e37d16eb93 100644 --- a/stable/airflow/templates/configmap-env.yaml +++ b/stable/airflow/templates/configmap-env.yaml @@ -18,7 +18,7 @@ data: ## Redis DB configuration REDIS_HOST: "{{ template "airflow.redis.host" . }}" REDIS_PORT: "{{ .Values.redis.master.port }}" - AIRFLOW__CELERY__FLOWER_URL_PREFIX: "{{ .Values.ingress.flower.path }}" + AIRFLOW__CELERY__FLOWER_URL_PREFIX: "{{ .Values.flower.urlPrefix }}" AIRFLOW__CELERY__WORKER_CONCURRENCY: "{{ .Values.workers.celery.instances }}" ## Flower PORT FLOWER_PORT: "5555" @@ -35,7 +35,7 @@ data: AIRFLOW__CORE__BASE_LOG_FOLDER: "{{ .Values.logs.path }}" AIRFLOW__CORE__DAG_PROCESSOR_MANAGER_LOG_LOCATION: "{{ printf "%s/%s" .Values.logs.path "dag_processor_manager/dag_processor_manager.log" }}" AIRFLOW__SCHEDULER__CHILD_PROCESS_LOG_DIRECTORY: "{{ printf "%s/%s" .Values.logs.path "scheduler" }}" - AIRFLOW__WEBSERVER__BASE_URL: "{{ .Values.ingress.web.host }}{{ .Values.ingress.web.path }}" + AIRFLOW__WEBSERVER__BASE_URL: "{{ .Values.web.baseUrl }}" # Disabling XCom pickling for forward compatibility AIRFLOW__CORE__ENABLE_XCOM_PICKLING: "false" # Note: changing `Values.airflow.config` won't change the configmap checksum and so won't make diff --git a/stable/airflow/values.yaml b/stable/airflow/values.yaml index 4c4c32bf51..110056ec91 100644 --- a/stable/airflow/values.yaml +++ b/stable/airflow/values.yaml @@ -199,6 +199,10 @@ scheduler: tolerations: [] flower: + ## + ## Set AIRFLOW__CELERY__FLOWER_URL_PREFIX + ## Prefix should match Ingress configuration ingress.flower.path + urlPrefix: "" resources: {} # limits: # cpu: "100m" @@ -226,6 +230,10 @@ flower: tolerations: [] web: + ## + ## Set AIRFLOW__WEBSERVER__BASE_URL + ## Path should match Ingress configuration + baseUrl: "http://localhost:8080" resources: {} # limits: # cpu: "300m" @@ -330,10 +338,10 @@ ingress: ## ## enable ingress ## Note: If you want to change url prefix for web ui or flower even if you do not use ingress, - ## you can still change ingress.web.path and ingress.flower.path + ## you can change web.baseUrl and flower.urlPrefix enabled: false ## - ## Configure the webserver endpoint + ## Configure the Ingress webserver endpoint web: ## NOTE: This requires an airflow version > 1.9.x ## For the moment (March 2018) this is **not** available on official package, you will have @@ -348,7 +356,7 @@ ingress: ## NOTE: do NOT keep trailing slash. For root configuration, set and empty string path: "" ## - ## hostname for the webserver + ## Ingress hostname for the webserver host: "" ## ## Annotations for the webserver @@ -383,7 +391,7 @@ ingress: ## servicePort: "use-annotation" ## - ## Configure the flower endpoind + ## Configure the flower Ingress endpoint flower: ## ## If flower is '/airflow/flower':