<p><strong>UPDATE</strong> Finally this is nothing to do with Azure File Share. It is actually the same case with Azure Disk and NFS or HostPath</p>

<p>I have mounted an Azure file Shares volume to a mongoDb pod with the mountPath /data. Everything seems to work as expected. When I exec into the pod, I can see mongo data in /data/db. But on the Azure File Shares I can only see the folders /db and /dbconfig, not the files. Any idea ? I have granted the permission 0777 to the volume.</p>

<p>This is my yaml files</p>

<p>StorageClass</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: azurefile
provisioner: kubernetes.io/azure-file
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=999
  - gid=999
parameters:
  storageAccount: ACCOUNT_NAME
  skuName: Standard_LRS
</code></pre>

<p>PVC </p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azurefile
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: azurefile
  resources:
    requests:
      storage: 20Gi
</code></pre>

<p>Mongo deployement file</p>

<pre><code>apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: mongo
  labels:
    app: mongo
  namespace: development
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongo
  template:
    metadata:
      labels:
        app: mongo
    spec:
      containers:
        - name: mongo
          image: "mongo"
          imagePullPolicy: IfNotPresent
          ports:
          - containerPort: 27017
            protocol: TCP
          volumeMounts:
          - mountPath: /data
            name: mongovolume
            subPath: mongo
      imagePullSecrets:
        - name: secret-acr
      volumes:
        - name: mongovolume
          persistentVolumeClaim:
            claimName: azurefile
</code></pre>

<p>Kubernetes version</p>

<pre><code>Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.6", GitCommit:"a21fdbd78dde8f5447f5f6c331f7eb6f80bd684e", GitTreeState:"clean", BuildDate:"2018-07-26T10:04:08Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

Aristo
<p>Solved the problem by changing mongo image for docker.io/bitnami/mongodb:4.0.2-debian-9. With this image, mongo data is written on the file share and the data is now persistant</p>
