Resolved: How to mount a windows share to a pod and into linux container inside a linux host (Windows share is behind proxy auth.)


Hello i’m trying to mount a windows share to a linux container. The way i’m trying to do this:
  • Mount windows share to kubernetes pod (running in linux machine)
  • Mount that drive into linux container

I run into a brick wall after trying lots of solutions. Last thing i tried was to edit kubernetes config.yml to mount drives the way i want. But i don’t know or find any way to pass proxy credentials to config.yml
My config file (Example of how i’m trying to do. Original file is too long.):
    name: app
        - SYS_ADMIN
    - mountPath: /mount/winshare
      name: nfs-volume
  - name: nfs-volume
      path: /E8_iT-Consultants/Upload
      server: <--server--Ip-->
How can I add credentials under “volumes:” tag? Is there a way to achieve what I want to do in any other way? I’m open to any suggestions.


Windows shares are using CIFS protocol, not NFS. NFS is not using login/password for authentication/authorization, its trust model is based on IP addresses of clients, and on Kerberos tokens in some more advanced configurations, so you can’t provide any credentials when using NFS.
There is no out-of-the box support for CIFS in kubernetes, but there is a community project that implements flexvolume plugin –
See Accessing CIFS files from pods for more details on how to use this plugin.

If you have better answer, please add a comment about this, thank you!