0

I have set up a glusterfs cluster, providing volumes for pods in kubernetes. There is no problems when mounting volume in the glusterfs way:

        "volumes": [
        {
            "name": "vol1",
            "glusterfs": {
                "endpoints": "glusterfs-cluster",
                "path": "a-gluster-vol"
            }
        }
    ]

My question is, can I use the gluster volume in nfs way? Such like

 "nfs": {
                "server": "someaddress",
                "path": "/a-gluster-vol"
            }

The pod is failedMount

50s     18s     7   {kubelet kube-node-21}          Warning     FailedMount MountVolume.SetUp failed for volume "kubernetes.io/nfs/818e0668-f7df-11e6-9f69-52540092af07-vol1" (spec.Name: "vol1") pod "818e0668-f7df-11e6-9f69-52540092af07" (UID: "818e0668-f7df-11e6-9f69-52540092af07") with: mount failed: exit status 32
Mounting command: mount
Mounting arguments: 192.168.16.180:/nfs /var/lib/kubelet/pods/818e0668-f7df-11e6-9f69-52540092af07/volumes/kubernetes.io~nfs/vol1 nfs []
Output: mount.nfs: requested NFS version or transport protocol is not supported
Haoyuan Ge
  • 3,379
  • 3
  • 24
  • 40
  • 1
    Do not use a gluster location without using the gluster client utils: It will make data NOT available through gluster without a repair action. – Norbert Feb 17 '17 at 19:18

2 Answers2

1
"volumes": [{
  "name": "vol1",
  "nfs": {
    "server": "glusterfs-server-ip",
    "path": "/a-gluster-vol"
  }
}]

For now you can only specify one server so it's not ideal.

Janos Lenart
  • 25,074
  • 5
  • 73
  • 75
0

The Gluster plugin in kubernetes works on FUSE, so the mount will be happening using FUSE client when you specify "gluster" in pod spec. However if you want to use it as a NFS share , you could try "nfs" spec in pod spec, but you have to make sure the "gluster nfs" service is running in Gluster Cluster.

Humble
  • 62
  • 3