How to mount volumes into Windows-based pods?

I set up a small Kubernetes cluster for testing, and for storage I use glusterfs. No CSI, I just create the volumes manually for now.

Now, I added a Windows node to the cluster. It works fine so far, but I can’t get any volumes to mount in the container.

I did a very simple pod definition:

apiVersion: v1
kind: Pod
  name: windows-test
    name: windows-test
    - name: sample
          cpu: "1.0"
          memory: "1Gi"
        - cmd
        - "/c"
        - "dir"
        - "/s"
        - 'c:\'
        - mountPath: "foo"
          name: testvol
    "": windows
    - name: testvol
        path: wintest
        endpoints: glusterfs-cluster
        readOnly: false

When I run this, the pod never starts and when I describe it, I get:
Warning FailedMount <invalid> kubelet, node09 MountVolume.SetUp failed for volume "testvol" : mount failed: only cifs mount is supported now, fstype: "glusterfs", mounting source (""), target ("c:\\var\\lib\\kubelet\\pods\\6d207138-09fb-4e1f-86e7-6a71cef5ce7e\\volumes\\\\testvol"), with options (["auto_unmount" "backup-volfile-servers=" "log-file=\\var\\lib\\kubelet\\plugins\\\\glusterfs\\testvol\\windows-test-glusterfs.log" "log-level=ERROR"]), the following error information was pulled from the glusterfs log to help diagnose this issue: could not open log file for pod windows-test

It seems that Windows pods do not support glusterfs, but only “cifs”. Can anyone guide me how to mount a volume via cifs? The only information I found in the docs was about the azure-file storage but I couldn’t figure out if that can also mount CIFS shares on-prem.

For CIFS Volumes, I’ve been configuring Persistent Volumes to use this plugin:

On Startup each node sets:


And then copies the smb script to that location and makes it executable.

I also added this flag to Kubelet Extra Args


Overall it has worked very well

Edit- it just occurred to me that you are doing this on your windows nodes, and so I don’t know if that plugin would work properly in that case. I guess I’ll leave this answer anyway because it would help someone who is trying to mount CIFS volumes on Linux hosts