forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a new documentation package for Helm Chart (apache#14643)
- Loading branch information
Showing
13 changed files
with
943 additions
and
424 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.. Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
Configuring Airflow | ||
------------------- | ||
|
||
All Airflow configuration parameters (equivalent of ``airflow.cfg``) are | ||
stored in | ||
`values.yaml <https://github.com/apache/airflow/blob/master/chart/values.yaml>`__ | ||
under the ``config`` key . The following code demonstrates how one would | ||
allow webserver users to view the config from within the webserver | ||
application. See the bottom line of the example: | ||
|
||
.. code-block:: yaml | ||
# Config settings to go into the mounted airflow.cfg | ||
# | ||
# Please note that these values are passed through the ``tpl`` function, so are | ||
# all subject to being rendered as go templates. If you need to include a | ||
# literal ``{{`` in a value, it must be expressed like this: | ||
# | ||
# a: '{{ "{{ not a template }}" }}' | ||
# | ||
# yamllint disable rule:line-length | ||
config: | ||
core: | ||
dags_folder: '{{ include "airflow_dags" . }}' | ||
load_examples: 'False' | ||
executor: '{{ .Values.executor }}' | ||
# For Airflow 1.10, backward compatibility | ||
colored_console_log: 'False' | ||
remote_logging: '{{- ternary "True" "False" .Values.elasticsearch.enabled }}' | ||
# Authentication backend used for the experimental API | ||
api: | ||
auth_backend: airflow.api.auth.backend.deny_all | ||
logging: | ||
remote_logging: '{{- ternary "True" "False" .Values.elasticsearch.enabled }}' | ||
colored_console_log: 'False' | ||
logging_level: DEBUG | ||
metrics: | ||
statsd_on: '{{ ternary "True" "False" .Values.statsd.enabled }}' | ||
statsd_port: 9125 | ||
statsd_prefix: airflow | ||
statsd_host: '{{ printf "%s-statsd" .Release.Name }}' | ||
webserver: | ||
enable_proxy_fix: 'True' | ||
expose_config: 'True' # <<<<<<<<<< BY DEFAULT THIS IS 'False' BUT WE CHANGE IT TO 'True' PRIOR TO INSTALLING THE CHART | ||
Generally speaking, it is useful to familiarize oneself with the Airflow | ||
configuration prior to installing and deploying the service. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.. Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
External Redis | ||
-------------- | ||
|
||
When using the ``CeleryExecutor`` or the ``CeleryKubernetesExecutor`` | ||
the chart will by default create a redis Deployment/StatefulSet | ||
alongside airflow. You can also use “your own” redis instance by | ||
providing the ``data.brokerUrl`` (or ``data.borkerUrlSecretName``) value | ||
directly: | ||
|
||
.. code-block:: bash | ||
helm install airflow . \ | ||
--namespace airflow \ | ||
--set executor=CeleryExecutor \ | ||
--set redis.enabled=false \ | ||
--set data.brokerUrl=redis://redis-user:password@redis-host:6379/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
.. Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
Helm Chart for Apache Airflow | ||
============================= | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
Home <self> | ||
quick-start | ||
airflow-configuration | ||
manage-dags-files | ||
keda | ||
external-redis | ||
|
||
.. toctree:: | ||
:hidden: | ||
:caption: References | ||
|
||
Parameters <parameters-ref> | ||
|
||
|
||
This chart will bootstrap an `Airflow <https://airflow.apache.org>`__ | ||
deployment on a `Kubernetes <http://kubernetes.io>`__ cluster using the | ||
`Helm <https://helm.sh>`__ package manager. | ||
|
||
Prerequisites | ||
------------- | ||
|
||
- Kubernetes 1.14+ cluster | ||
- Helm 2.11+ or Helm 3.0+ | ||
- PV provisioner support in the underlying infrastructure | ||
|
||
Installing the Chart | ||
-------------------- | ||
|
||
To install this repository from source (using helm 3) | ||
|
||
.. code-block:: bash | ||
kubectl create namespace airflow | ||
helm dep update | ||
helm install airflow . --namespace airflow | ||
The command deploys Airflow on the Kubernetes cluster in the default configuration. The :doc:`parameters-ref` | ||
section lists the parameters that can be configured during installation. | ||
|
||
> **Tip**: List all releases using ``helm list``. | ||
|
||
Upgrading the Chart | ||
------------------- | ||
|
||
To upgrade the chart with the release name ``airflow``: | ||
|
||
.. code-block:: bash | ||
helm upgrade airflow . --namespace airflow | ||
Uninstalling the Chart | ||
---------------------- | ||
|
||
To uninstall/delete the ``airflow`` deployment: | ||
|
||
.. code-block:: bash | ||
helm delete airflow --namespace airflow | ||
The command removes all the Kubernetes components associated with the chart and deletes the release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.. Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
.. http://www.apache.org/licenses/LICENSE-2.0 | ||
.. Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
Autoscaling with KEDA | ||
--------------------- | ||
|
||
*This feature is still experimental.* | ||
|
||
KEDA stands for Kubernetes Event Driven Autoscaling. | ||
`KEDA <https://github.com/kedacore/keda>`__ is a custom controller that | ||
allows users to create custom bindings to the Kubernetes `Horizontal Pod | ||
Autoscaler <https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/>`__. | ||
We have built scalers that allows users to create scalers based on | ||
PostgreSQL queries and shared it with the community. This enables us to | ||
scale the number of airflow workers deployed on Kubernetes by this chart | ||
depending on the number of task that are ``queued`` or ``running``. | ||
|
||
.. code-block:: bash | ||
helm repo add kedacore https://kedacore.github.io/charts | ||
helm repo update | ||
helm install \ | ||
--set image.keda=docker.io/kedacore/keda:1.2.0 \ | ||
--set image.metricsAdapter=docker.io/kedacore/keda-metrics-adapter:1.2.0 \ | ||
--namespace keda --name keda kedacore/keda | ||
Once KEDA is installed (which should be pretty quick since there is only | ||
one pod). You can try out KEDA autoscaling on this chart by setting | ||
``workers.keda.enabled=true`` your helm command or in the | ||
``values.yaml``. (Note: KEDA does not support StatefulSets so you need | ||
to set ``worker.persistence.enabled`` to ``false``) | ||
|
||
.. code-block:: bash | ||
kubectl create namespace airflow | ||
helm install airflow . \ | ||
--namespace airflow \ | ||
--set executor=CeleryExecutor \ | ||
--set workers.keda.enabled=true \ | ||
--set workers.persistence.enabled=false | ||
KEDA will derive the desired number of celery workers by querying | ||
Airflow metadata database: | ||
|
||
.. code-block:: none | ||
SELECT | ||
ceil(COUNT(*)::decimal / {{ .Values.config.celery.worker_concurrency }}) | ||
FROM task_instance | ||
WHERE state='running' OR state='queued' | ||
You should set celery worker concurrency through the helm value | ||
``config.celery.worker_concurrency`` (i.e. instead of airflow.cfg or | ||
environment variables) so that the KEDA trigger will be consistent with | ||
the worker concurrency setting. |
Oops, something went wrong.