https://www.astronomer.io/events/recaps/official-airflow-helm-chart
我按照教程在Windows 10
WSL2
docker desktop
上构建了一个气流,我想安装一个本地持久化dags文件夹。我尝试在我的dag文件夹中什么也没有得到,也没有错误消息。
如何正确设置values.yaml
、pv.yaml
和pvc.yaml
来挂载本地持久性dags文件夹?
我的舵手values.yaml
、pv.yaml
和pvc.yaml
最终都是列表,我列出了我使用的params。
我的气流数据文件夹位于:c:\airflow-home\dags\pipelines
我尝试过在下面挂载我的守护文件夹(所有都失败了,没有错误,并且vm中的dag文件夹仍然是空的):
values.yaml
dags:
persistence:
# Enable persistent volume for storing dags
enabled: true
# Volume size for dags
size: 10Gi
# If using a custom storageClass, pass name here
storageClassName:
# access mode of the persistent volume
accessMode: ReadWriteOnce
## the name of an existing PVC to use
existingClaim: local-dags-folder
pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-dags-folder
namespace: airflow
labels:
type: local
spec:
storageClassName: local-storage
capacity:
storage: 10Gi
accessModes:
###############
# What should I use?
#- ReadWriteOnce
#- ReadWriteMany
###############
- ReadWriteOnce
###############
# What should I use? hostPath or Filesystem
###############
volumeMode: Filesystem
local:
###############
#I tried this and no use
#path: /run/desktop/mnt/host/c/airflow-home/dags/pipelines
###############
path: /c/airflow-home/dags/pipelines
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
###############
# I tried `docker-desktop` and get a error, so change to `kind-control-plane`
###############
- kind-control-plane
pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-dags-folder
namespace: airflow
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
发布于 2022-08-28 01:43:21
我遇到了类似的问题,下面是有效的解决方案。确保在Docker窗口上启用了WSL。使用本地路径作为/run/desktop/mnt/host/c/airflow-home/dags/pipelines
pv.yaml文件
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-dags-folder
namespace: airflow
labels:
type: local
spec:
storageClassName: local-path
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
volumeMode: Filesystem
local:
path: /run/desktop/mnt/host/c/airflow
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- docker-desktop
pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-dags-folder
namespace: airflow
spec:
storageClassName: local-path
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
气流舵values.yml文件
dags:
persistence:
enabled: true
size: 2Gi
storageClassName: docker-desktop
accessMode: ReadWriteMany
existingClaim: local-dags-folder
https://stackoverflow.com/questions/70269888
复制相似问题