GlusterFS / BeeGFS on Rancher?

Hi! I’m trying to set up GlusterFS and BeeGFS on rancher for testing with a containerized web server stack. However, I can’t really find any information on setting them up on rancher, so how do I set them up? Any good docs to read?

UPDATE: I wrote an extended version of this entry on my website: https://laszlo.cloud/Rancher-Kubernetes-persistence-with-GlusterFS


For Kubernetes or Cattle?

For Kube I just did it quickly.

I’d set gluster up on dedicated nodes first. With this one page guide, it’s like one hour to create a dummy cluster http://gluster.readthedocs.io/en/latest/Quick-Start-Guide/Quickstart/

Then define the Persistent Volumes(PV) and the claims (PVC) just like on any Kube http://docs.rancher.com/rancher/v1.6/en/kubernetes/storage/

40-gluster-endpoint.yml
apiVersion: v1
kind: Endpoints
metadata:
name: glusterfs-cluster
subsets:

  • addresses:
    • ip: 10.0.1.102
      ports:
    • port: 1
  • addresses:
    • ip: 10.0.1.103
      ports:
    • port: 1

40-gluster-svc.yml
apiVersion: v1
kind: Service
metadata:
name: glusterfs-cluster
spec:
ports:

  • port: 1

40-persistent-volume.yml
apiVersion: v1
kind: PersistentVolume
metadata:
name: fileupload-vol
labels:
dev: dev
spec:
accessModes:

  • ReadWriteMany
    capacity:
    storage: 500M
    glusterfs:
    endpoints: glusterfs-cluster
    path: gv0
    persistentVolumeReclaimPolicy: Recycle

40-pvc.yml
apiVersion: v1
kind: PersistentVolume
metadata:
name: fileupload-vol
labels:
dev: dev
spec:
accessModes:

  • ReadWriteMany
    capacity:
    storage: 500M
    glusterfs:
    endpoints: glusterfs-cluster
    path: gv0
    persistentVolumeReclaimPolicy: Recycle

Then in your service yaml
volumeMounts:
- mountPath: /mnt/test
name: dir-1
volumes:
- name: dir-1
persistentVolumeClaim:
claimName: file-upload-claim

2 Likes

Thanks! Sorry for not specifying, I’ve mostly tested Cattle yet, but I guess it doesn’t matter too much. Great asnwer though and it will help me set up gluster on Kube at least!