I'm running a Kubernetes 1.8.4 cluster on Azure (populated with acs-engine v0.10).
I need to run a Redis pod with data persistency, so I'm using persistentVolume / persistentVolumeClaim with azurefile
storageClass so that Redis can save to that volume.
Problem is that Redis container is running with redis:redis user and that Kubernetes mounts the volume with a root:root ownership and 0700 access mode.
=> So Redis can't write to that volume and dies.
Normally I'd fix this with mountOptions, but I fear this option is not supported for AzureFiles as per Kubernetes documentation:
Note: Not all Persistent volume types support mount options.
Did anybody ever managed to mount AzureFiles volumes in a Kubernetes pod with non-root access ? If so, I'd love to know how :-)
TIA!
After reviewing this providential CloudBees blog post, it turned out that mountOptions are supported for azurefile, it's just that I needed to create a dedicated StorageClass and consume it via a PersistentVolumeClaim.
An alternative solution from Azure is to mount the azurefile as a persistent volume claim. https://docs.microsoft.com/en-us/azure/aks/azure-files-volume#mount-file-share-as-an-persistent-volume
uid, gid
along with file system permissions can be passed (0777).Personally, tried and it tested!