apiVersion: v1
kind: PersistentVolume
metadata:
  name: nlp.mysqlbackup
  namespace: fabricnlp    
  labels:
    type: azure  
    namespace: fabricnlp  
spec:
  storageClassName: default
  capacity:
    storage: 16Gi
  # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes
  accessModes:
    - ReadWriteMany
  # https://kubernetes.io/docs/api-reference/v1.8/#azurefilepersistentvolumesource-v1-core
  azureFile:
    secretName: azure-secret
    secretNamespace: default
    shareName: fabricnlpbackups
    readOnly: false
  mountOptions:
  # we need to set owner of this to mysql user (999) so it has permissions to this folder
    - uid=999
    - gid=999
  # and set permissions for the user to this folder
  # 0 no permissions
  # 1 execute
  # 2 write
  # 3 write & execute
  # 4 read
  # 5 read & execute
  # 6 read & write
  # 7 read write & execute  
  # in 0731 0 is ignore, the 7 applies to owner, 3 applies to group, 1 applies to everyone else
    - dir_mode=0731
    - file_mode=0764
  claimRef:
    namespace: fabricnlp
    name: nlp.mysqlbackup
