<p>I would  like to deploy Airflow locally on Minikube and have a local folder mounted for DAGs handling.</p>
<p>Airflow is deployed like this:</p>
<pre><code>helm install $AIRFLOW_NAME apache-airflow/airflow \
    --values values.yml \
    --set logs.persistence.enabled=true \
    --namespace $AIRFLOW_NAMESPACE \
    --kubeconfig ~/.kube/config
</code></pre>
<p>The <code>values.yml</code> looks like this:</p>
<pre><code>executor: KubernetesExecutor
config:
  core:
    dags_folder: /dags
webserver:
  extraVolumes:
    - name: dags
      hostPath:
        path: /path/dags
  extraVolumeMounts:
    - name: dags
      mountPath: /dags
</code></pre>
<p><code>kubectl describe pods airflow-webserver --kubeconfig ~/.kube/config  --namespace airflow</code>:</p>
<pre><code>Volumes:
  config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      airflow-airflow-config
    Optional:  false
  logs:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  airflow-logs
    ReadOnly:   false
  dags:
    Type:          HostPath (bare host directory volume)
    Path:          /path/dags/
    HostPathType:  
  airflow-webserver-token-xtq9h:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  airflow-webserver-*
    Optional:    false
QoS Class:       BestEffort
</code></pre>
<p>The volume dags appears to be correctly mounted but remains empty.
What could cause this behaviour ?</p>
<p>Edit:
<code>kubectl describe pods airflow-scheduler-0 --kubeconfig ~/.kube/config --namespace airflow</code></p>
<pre><code>    Mounts:
      /opt/airflow/airflow.cfg from config (ro,path=&quot;airflow.cfg&quot;)
      /opt/airflow/dags from dags (rw)
      /opt/airflow/logs from logs (rw)
      /opt/airflow/pod_templates/pod_template_file.yaml from config (ro,path=&quot;pod_template_file.yaml&quot;)
      /var/run/secrets/kubernetes.io/serviceaccount from airflow-scheduler-token-9zfpv (ro)
</code></pre>
<pre><code>Volumes:
  config:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      airflow-airflow-config
    Optional:  false
  dags:
    Type:          HostPath (bare host directory volume)
    Path:          /path/dags
    HostPathType:  
  logs:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  airflow-logs
    ReadOnly:   false
  airflow-scheduler-token-9zfpv:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  airflow-scheduler-token-9zfpv
    Optional:    false
</code></pre>

val
<p>I was completely mistaking the <code>hostPath</code> parameter for my local machine.
<code>hostPath</code> refers to the Minikube node running the pod.</p>
<pre><code>  extraVolumes:
    - name: dags
      hostPath:
        path: /mnt/airflow/dags
        type: Directory
  extraVolumeMounts:
    - name: dags
      mountPath: /opt/airflow/dags
</code></pre>
<p>This will mount a volume between the Minikube host node and the port.
The path <code>/mnt/airflow/dags</code> <strong>must not be present on the local machine</strong>.</p>
<p>The local DAGs folder can then be mounted into the Minikube node:</p>
<p><code>minikube mount ./dags/:/mnt/airflow/dags</code></p>
<p>See: <a href="https://medium.com/@ipeluffo/running-apache-airflow-locally-on-kubernetes-minikube-31f308e3247a" rel="nofollow noreferrer">https://medium.com/@ipeluffo/running-apache-airflow-locally-on-kubernetes-minikube-31f308e3247a</a></p>
