<p>I feel a bit like an idiot but I cannot seem to get the logging working on persistent volumes when using the KubernetesExecutor and the freshly released official Helm chart.</p>
<p>After creating a simple <a href="https://github.com/marclamberti/webinar-airflow-chart/blob/master/pv.yaml" rel="nofollow noreferrer">PV</a> and <a href="https://github.com/marclamberti/webinar-airflow-chart/blob/master/pvc.yaml" rel="nofollow noreferrer">PVC</a> manually, I changed the following on the bottom of  values.yaml file:</p>
<pre><code>logs:
  persistence:
    # Enable persistent volume for storing logs
    enabled: true
    # Volume size for logs
    size: 100Gi
    # If using a custom storageClass, pass name here
    storageClassName:
    ## the name of an existing PVC to use
    existingClaim: airflow-logs
</code></pre>
<p>This process is partly described in the <a href="https://airflow.apache.org/docs/helm-chart/stable/manage-logs.html" rel="nofollow noreferrer">official Helm documentation</a>.
Still, the airflow-scheduler pod crashes due to permission errors as i cannot write in the mounted logs folder: <a href="https://pastebin.com/ek3iH4EZ" rel="nofollow noreferrer">logs here</a>.</p>
<p>When the persistent logging is turned off, all is working, except for task logging as these are deleted when the worker-pod is deleted.</p>
<p>Any help towards a solution would be greatly appreciated!</p>

<p>I assumed that using standard persistent volume approach was the easiest (I am still a k8s novice) I did not expect that setting up one using azure-file-storage-class (SC) was this easy. These mounts can be set up using 777 rights from the SC yaml file, not sure if this is the sole cure as I also set the uid/gid in the SC mount options. Anyhow, all seems to be working perfectly.</p>
<p>As a reference for otheres here my azure-file-sc.yaml:</p>
<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: airflow-logs
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=50000
  - gid=0
  - mfsymlinks
  - cache=strict
  - actimeo=30
parameters:
  skuName: Standard_LRS
</code></pre>
<p>My azure-file-pvc.yaml:</p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: airflow-logs
  namespace: airflow
  labels:
    app: airflow-logs
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: airflow-logs
  resources:
    requests:
      storage: 20Gi
</code></pre>
<p>The values.yaml is unchanged.</p>
<p>With this, the persistent logging works like a charm in Azure Kubernetes Service (AKS).</p>
<p>Hope this helps others!
Dennis</p>
