https://www.astronomer.io/events/recaps/official-airflow-helm-chart
I followed the tutorial to build a airflow on Windows 10
WSL2
docker desktop
, and I want to mount a local persistence dags folder. I tried and got nothing in my dag folder, and no error message either.
What is a correct setting of values.yaml
, pv.yaml
and pvc.yaml
to mount a local persistence dags folder?
My helm values.yaml
, pv.yaml
, and pvc.yaml
are list in the end, and I listed the params I used.
My airflow dag folder is at: c:\airflow-home\dags\pipelines
I have tried these article to mount my dag folder below(all was failed, no errors, and dag folder in vm still empty):
- https://stackoverflow.com/a/63524931/16933247
- https://github.com/docker/for-win/issues/5325#issuecomment-570683131
- https://stackoverflow.com/a/55397228/16933247
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