客观的
我想在 Kubernetes 上部署 Airflow,其中 Pod 可以访问共享持久卷中的相同 DAG。
根据文档(https://github.com/helm/charts/tree/master/stable/airflow#using-one-volume-for-both-logs-and-dags https://github.com/helm/charts/tree/master/stable/airflow#using-one-volume-for-both-logs-and-dags),看来我必须设置这些值并将其传递给 Helm:extraVolume
, extraVolumeMount
, persistence.enabled
, logsPersistence.enabled
, dags.path
, logs.path
.
Problem
我在安装官方 Helm 图表时传递的任何自定义值都会导致类似于以下内容的错误:
Error: YAML parse error on airflow/templates/deployments-web.yaml: error converting YAML to JSON: yaml: line 69: could not find expected ':'
- 工作正常:
microk8s.helm install --namespace "airflow" --name
"airflow" stable/airflow
-
不工作:
microk8s.helm install --namespace "airflow" --name "airflow" stable/airflow \
--set airflow.extraVolumes=/home/*user*/github/airflowDAGs \
--set airflow.extraVolumeMounts=/home/*user*/github/airflowDAGs \
--set dags.path=/home/*user*/github/airflowDAGs/dags \
--set logs.path=/home/*user*/github/airflowDAGs/logs \
--set persistence.enabled=false \
--set logsPersistence.enabled=false
-
Also not working:
microk8s.helm install --namespace "airflow" --name "airflow" stable/airflow --values=values_pv.yaml
, with values_pv.yaml
: https://pastebin.com/PryCgKnC https://pastebin.com/PryCgKnC
- 编辑:请更改
/home/*user*/github/airflowDAGs
到您计算机上的路径以复制错误。
Concerns
- 也许是因为默认的这些行而出错
values.yaml
:
## Configure DAGs deployment and update
dags:
##
## mount path for persistent volume.
## Note that this location is referred to in airflow.cfg, so if you change it, you must update airflow.cfg accordingly.
path: /home/*user*/github/airflowDAGs/dags
我该如何配置airflow.cfg
在 Kubernetes 部署中?在 Airflow 的非容器化部署中,可以在以下位置找到此文件~/airflow/airflow.cfg
.
- 69号线
airflow.cfg
指:https://github.com/helm/charts/blob/master/stable/airflow/templates/deployments-web.yaml#L69 https://github.com/helm/charts/blob/master/stable/airflow/templates/deployments-web.yaml#L69
其中包含git
。是.yaml
配置错误,并且错误地尝试使用git pull
,但是由于没有指定 git 路径,所以失败了?
System
- 操作系统:Ubuntu 18.04(单机)
- MicroK8s:v1.15.4 修订版:876
-
microk8s.kubectl version
:v1.15.4
-
microk8s.helm version
:v2.14.3
Question
如何正确地将正确的值传递到 Airflow Helm 图表,以便能够在 Kubernetes 上部署 Airflow,并且 Pod 可以访问共享持久卷上的相同 DAG 和日志?