Forum Discussion

chanev's avatar
chanev
Copper Contributor
Mar 20, 2021

Azure Kubernetes Service - Windows mountPath is not mounted on Azure File Share

Kubernetes - cannot have Windows path mounted on Azure File Share (Linux mounting works properly )

Firstly I successfully mounted, my Linux path on Pod. I used azure file share and mounted folders appear on File Share.

    volumeMounts:
      - name: ads-filesharevolume
        mountPath: /opt/front/arena/host
  volumes:
  - name: ads-filesharevolume
    azureFile:
      secretName: fa-fileshare-secret
      shareName: faselectaksshare
      readOnly: false

 

Now in File Share I added one subfolder "windows" for mounting, in logs it mentions it is being mounted properly but I do not have anything mounted (folders and files do not appear on mounted share like it is the case for Linux) after I try to run my Pod (Containers)

   args: [ "-license_file", "C:/Host/dat/license.dat",
           "-key_file", "C:/Host/dat/license.key"]
    volumeMounts:
      - name: ads-win-filesharevolume
        mountPath: "C:\\host"
  volumes:
  - name: ads-win-filesharevolume
    azureFile:
      secretName: fa-fileshare-secret
      shareName: faselectaksshare\windows
      readOnly: false

For mountPath I tried with many options: C:\\host and C:/host and /c/host 
Also for shareName I initially tried with faselectaksshare/windows but it threw an exception.
So I defined it like this: faselectaksshare\windows
With  describe pod I can see that everything is OK but I do not see my mounted folders and files in faselectaksshare\windows

    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-nx49r (ro)
      C:/host from ads-win-filesharevolume (rw)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  ads-win-filesharevolume:
    Type:        AzureFile (an Azure File Service mount on the host and bind mount to the pod)
    SecretName:  fa-fileshare-secret
    ShareName:   faselectaksshare\windows
    ReadOnly:    false

Please help! Thanks

 

No RepliesBe the first to reply

Resources