Using azure file storage with kubernetes and azure container service (aks) - permission denied Using azure file storage with kubernetes and azure container service (aks) - permission denied kubernetes kubernetes

Using azure file storage with kubernetes and azure container service (aks) - permission denied


We came across the same problems and figured out the following solution:

Instead of using an AzureFileVolume, we used an AzureDisk. So what we needed in Kubernetes is the following...

Storage Class

enter image description here

With your Azure account name

Persistent Volume Claim

Persistent Volume Claim

PostgreSQL DeploymentInclude PVC in the Kubernetes Deployment

- name: postgres-db  persistentVolumeClaim:      claimName: pvc-postgresdb

Additionally we need to point the PGDATA var to a subdirectory of the mounted directory. Because Azure is creating some issues with the AzureDisk type in the base directory.

#... evn definitions... - name: PGDATA  value: /var/lib/postgresql/data/pgdatavolumeMounts:- mountPath: /var/lib/postgresql/data/  name: postgres-db


This won't work you need to use azure disks, reason postgres uses hard links which are not supported by azure fileshttps://github.com/docker-library/postgres/issues/548