Azure Files Shares with Symlinks support on AKS

Mounting Azure File Shares on AKS using the Azure Files volume type doesn’t enable support for symlinks. You can fix this with a very simple tweak.

Based on the discoveries of the great Lawrence Gripper, I recently discovered that a CIFS mount in Ubuntu is not enabling by default the support for symlinks.

Therefore, in order to mount an share with the symlink support you have to create a PersistentVolume like this:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: sample-symlinks
  labels:
    usage: sample-symlinks
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  #Really important to specify this mountOption
  mountOptions:
    - mfsymlinks
  azureFile:
    # Replace with your secret name containing azurestorageaccountname and azurestorageaccountkey
    secretName: azure-secret
    # Replace with correct Azure Files Share name
    shareName: damaggioshare
    readOnly: false
pv.yaml

Have fun!

Spread this article

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.