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

%3CLINGO-SUB%20id%3D%22lingo-sub-2225138%22%20slang%3D%22en-US%22%3EAzure%20Kubernetes%20Service%20-%20Windows%20mountPath%20is%20not%20mounted%20on%20Azure%20File%20Share%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2225138%22%20slang%3D%22en-US%22%3E%3CP%3EKubernetes%20-%20cannot%20have%20Windows%20path%20mounted%20on%20Azure%20File%20Share%20(Linux%20mounting%20works%20properly%20)%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EFirstly%20I%20successfully%20mounted%2C%20my%20Linux%20path%20on%20Pod.%20I%20used%20azure%20file%20share%20and%20mounted%20folders%20appear%20on%20File%20Share.%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EvolumeMounts%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-bullet%22%3E-%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Ename%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eads-filesharevolume%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EmountPath%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3E%2Fopt%2Ffront%2Farena%2Fhost%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-attr%22%3Evolumes%3A%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-bullet%22%3E-%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Ename%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eads-filesharevolume%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EazureFile%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EsecretName%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efa-fileshare-secret%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EshareName%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efaselectaksshare%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EreadOnly%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20in%20File%20Share%20I%20added%20one%20subfolder%20%22windows%22%20for%20mounting%2C%20in%20logs%20it%20mentions%20it%20is%20being%20mounted%20properly%20but%20I%20do%20not%20have%20anything%20mounted%20(folders%20and%20files%20do%20not%20appear%20on%20mounted%20share%20like%20it%20is%20the%20case%20for%20Linux)%20after%20I%20try%20to%20run%20my%20Pod%20(Containers)%3C%2FP%3E%3CPRE%3E%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3Eargs%3A%3C%2FSPAN%3E%20%5B%20%3CSPAN%20class%3D%22hljs-string%22%3E%22-license_file%22%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22hljs-string%22%3E%22C%3A%2FHost%2Fdat%2Flicense.dat%22%3C%2FSPAN%3E%2C%0A%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3E%22-key_file%22%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22hljs-string%22%3E%22C%3A%2FHost%2Fdat%2Flicense.key%22%3C%2FSPAN%3E%5D%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EvolumeMounts%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-bullet%22%3E-%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Ename%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eads-win-filesharevolume%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EmountPath%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3E%22C%3A%5C%5Chost%22%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-attr%22%3Evolumes%3A%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-bullet%22%3E-%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-attr%22%3Ename%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eads-win-filesharevolume%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EazureFile%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EsecretName%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efa-fileshare-secret%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EshareName%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efaselectaksshare%5Cwindows%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EreadOnly%3A%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%0A%3C%2FPRE%3E%3CP%3EFor%20mountPath%20I%20tried%20with%20many%20options%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EC%3A%5C%5Chost%3C%2FSTRONG%3E%26nbsp%3Band%26nbsp%3B%3CSTRONG%3EC%3A%2Fhost%20%3C%2FSTRONG%3E%3CSPAN%3Eand%3CSTRONG%3E%26nbsp%3B%2Fc%2Fhost%3C%2FSTRONG%3E%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3EAlso%20for%20%3CSTRONG%3EshareName%3C%2FSTRONG%3E%20I%20initially%20tried%20with%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Efaselectaksshare%2Fwindows%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebut%20it%20threw%20an%20exception.%3CBR%20%2F%3ESo%20I%20defined%20it%20like%20this%3A%20%3CSTRONG%3Efaselectaksshare%5Cwindows%3C%2FSTRONG%3E%3CBR%20%2F%3EWith%20%3CSPAN%20class%3D%22hljs-attr%22%3E%26nbsp%3Bdescribe%20pod%3C%2FSPAN%3E%26nbsp%3BI%20can%20see%20that%20everything%20is%20OK%20but%20I%20do%20not%20see%20my%20mounted%20folders%20and%20files%20in%20faselectaksshare%5Cwindows%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EMounts%3A%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3E%2Fvar%2Frun%2Fsecrets%2Fkubernetes.io%2Fserviceaccount%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efrom%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Edefault-token-nx49r%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3E(ro)%3C%2FSPAN%3E%0A%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3EC%3A%2Fhost%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Efrom%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eads-win-filesharevolume%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3E(rw)%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-attr%22%3EConditions%3A%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-string%22%3EType%3C%2FSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3EStatus%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-string%22%3EInitialized%3C%2FSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-literal%22%3ETrue%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-string%22%3EReady%3C%2FSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-literal%22%3EFalse%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-string%22%3EContainersReady%3C%2FSPAN%3E%20%20%20%3CSPAN%20class%3D%22hljs-literal%22%3EFalse%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-string%22%3EPodScheduled%3C%2FSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-literal%22%3ETrue%3C%2FSPAN%3E%0A%3CSPAN%20class%3D%22hljs-attr%22%3EVolumes%3A%3C%2FSPAN%3E%0A%20%20%3CSPAN%20class%3D%22hljs-attr%22%3Eads-win-filesharevolume%3A%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EType%3A%3C%2FSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3EAzureFile%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3E(an%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3EAzure%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3EFile%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3EService%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Emount%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eon%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Ethe%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Ehost%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eand%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Ebind%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Emount%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Eto%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Ethe%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-string%22%3Epod)%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3ESecretName%3A%3C%2FSPAN%3E%20%20%3CSPAN%20class%3D%22hljs-string%22%3Efa-fileshare-secret%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EShareName%3A%3C%2FSPAN%3E%20%20%20%3CSPAN%20class%3D%22hljs-string%22%3Efaselectaksshare%5Cwindows%3C%2FSPAN%3E%0A%20%20%20%20%3CSPAN%20class%3D%22hljs-attr%22%3EReadOnly%3A%3C%2FSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22hljs-literal%22%3Efalse%3C%2FSPAN%3E%0A%3C%2FPRE%3E%3CP%3EPlease%20help!%20Thanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

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

 

0 Replies