Switch branches/tags
v5.3.0-alpha.1 v5.2.0 v5.1.0 v5.0.1 v5.0.0 v4.0.0 v4.0.0-beta v3.0.0-beta.2 v3.0.0-beta.1 v3.0.0-beta v2.1.0 v2.0.0 v2.0.0-beta v1.10.beta v1.8.0 v1.0.0 standalone-cinder-provisioner-v1.0.0-k8s1.10 rbd-provisioner-v2.1.1-k8s1.11 rbd-provisioner-v2.1.0-k8s1.11 rbd-provisioner-v2.0.1-k8s1.11 rbd-provisioner-v2.0.0-k8s1.11 rbd-provisioner-v1.1.1-k8s1.11 rbd-provisioner-v1.1.0-k8s1.10 rbd-provisioner-v1.0.0-k8s1.10 rbd-provisioner-v0.1.1 rbd-provisioner-v0.1.0 openebs-provisioner-v0.1.0 nfs-provisioner-v2.2.0-k8s1.12 nfs-provisioner-v2.1.0-k8s1.11 nfs-provisioner-v2.0.1-k8s1.11 nfs-provisioner-v2.0.0-k8s1.11 nfs-provisioner-v1.1.0-k8s1.10 nfs-provisioner-v1.0.9 nfs-client-provisioner-v3.1.0-k8s1.11 nfs-client-provisioner-v3.0.2-k8s1.11 nfs-client-provisioner-v3.0.1-k8s1.11 nfs-client-provisioner-v3.0.0-k8s1.11 nfs-client-provisioner-v2.1.2-k8s1.11 nfs-client-provisioner-v2.1.1-k8s1.10 nfs-client-provisioner-v2.1.0-k8s1.10 nfs-client-provisioner-v2.0.1 nfs-client-provisioner-v2.0.0 nfs-client-provisioner-arm-v2.1.1-k8s1.10 nfs-client-provisioner-arm-v2.1.0-k8s1.10 local-volume-provisioner-v2.2.0 local-volume-provisioner-v2.1.0 local-volume-provisioner-v2.0.0 local-volume-provisioner-v1.0.1 local-volume-provisioner-v1.0.0 local-volume-provisioner-bootstrap-v1.0.1 local-volume-provisioner-bootstrap-v1.0.0 kubernetes-1.12.0-beta.1 iscsi-controller-v0.0.3 iscsi-controller-v0.0.2 iscsi-controller-v0.0.1 glusterfs-simple-provisioner-v2.1.0-k8s1.11 glusterfs-simple-provisioner-v2.0.1-k8s1.11 glusterfs-simple-provisioner-v2.0.0-k8s1.11 glusterfs-simple-provisioner-v1.0.0-k8s1.10 glusterfs-simple-provisioner-v0.1.0 glusterblock-provisioner-v2.1.0-k8s1.11 glusterblock-provisioner-v2.0.1-k8s1.11 glusterblock-provisioner-v2.0.0-k8s1.11 glusterblock-provisioner-v1.0.2 glusterblock-provisioner-v1.0.1 glusterblock-provisioner-v1.0.0 glusterblock-provisioner-v0.9.5 glusterblock-provisioner-v0.9.0 flex-provisioner-v2.1.0-k8s1.11 flex-provisioner-v2.0.1-k8s1.11 flex-provisioner-v2.0.0-k8s1.11 flex-provisioner-v1.0.1-k8s1.10 flex-provisioner-v1.0.0-k8s1.10 efs-provisioner-v2.1.0-k8s1.11 efs-provisioner-v2.0.1-k8s1.11 efs-provisioner-v2.0.0-k8s1.11 efs-provisioner-v1.0.0-k8s1.10 efs-provisioner-v0.1.2 efs-provisioner-v0.1.1 efs-provisioner-v0.1.0 cephfs-provisioner-v2.1.0-k8s1.11 cephfs-provisioner-v2.0.1-k8s1.11 cephfs-provisioner-v2.0.0-k8s1.11 cephfs-provisioner-v1.1.0-k8s1.10 cephfs-provisioner-v1.0.0-k8s1.10 cephfs-provisioner-v0.1.2 cephfs-provisioner-v0.1.1 cephfs-provisioner-v0.1.0 1.8.1
Nothing to show
Find file History

README.md

GlusterFS Simple Provisioner for Kubernetes 1.5+

GlusterFS simple provisioner is an external provisioner which dynamically provision glusterfs volumes on demand.

Unlike Heketi, this provisioner will not manage GlusterFS cluster. So that you must manage GlusterFS cluster by yourself. This will simply create Gluster volume in the specified GlusterFS cluster like nfs-client provisioner.

It means, for example, if you want to add brick to your Gluster volume, you can use familiar gluster vol add-brick command.

Build GlusterFS Simple Provisioner and container image

[root@localhost]# make container

Start Kubernetes local cluster

Start GlusterFS cluster on Kubernetes

GlusterFS Simple Provisioner requires Gluster cluster which is running on the top of Kubernetes cluster.

[root@localhost]# kubectl create -f deploy/glusterfs-daemonset.yaml
[root@localhost]# kubectl label node <...node...> storagenode=glusterfs

Configure the GlusterFS trusted pool

GlusterFS Simple Provisioner will not manage GlusterFS cluster at all, so it is needed to manage GlusterFS cluster by yourself.

Check GlusterFS node's podIPs.

[root@localhost]# kubectl get pods -o wide --selector=glusterfs-node=pod
NAME              READY     STATUS    RESTARTS   AGE       IP             NODE
glusterfs-grck0   1/1       Running   0          11m       172.16.2.132   worker02
glusterfs-mgmnd   1/1       Running   0          11m       172.16.2.131   worker01

And add nodes to trusted pool

[root@localhost]# kubectl exec -ti glusterfs-grck0 gluster peer probe 172.16.2.131
[root@localhost]# kubectl exec -ti glusterfs-mgmnd gluster peer probe 172.16.2.132

Configure RBAC (Kubernetes 1.8+)

If you are running Kubernetes 1.8+, you will need to bind a set of permissions to a new ServiceAccount for the provisioner to access the Kubernetes API.

Run the following to configure RBAC for a new glfs-provisioner ServiceAccount:

kubectl create -f deploy/rbac.yaml

NOTE: Make sure that your deployment contains a reference to serviceAccount: glfs-provisioner.

Start glusterfs simple provisioner

The following example assumes kubeconfig is at /root/.kube.

docker run -ti \
           -v /root/.kube:/kube \
           -v /var/run/kubernetes:/var/run/kubernetes \
           external_storage/glusterfs-simple-provisioner \
              -kubeconfig=/kube/config

Create a glusterfs-simple Storage Class

echo 'kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: glusterfs-simple
provisioner: gluster.org/glusterfs-simple
parameters:
  forceCreate: "true"
  brickrootPaths: "172.16.2.131:/tmp/,172.16.2.132:/tmp"' | kubectl create -f -

The available storage class parameter are listed below:

parameters:
    brickRootPaths: "172.16.2.131:/tmp/,172.16.2.132:/tmp"
    volumeType: "replica 2"
    namespace: "default"
    selector: "glusterfs-node==pod"
    forceCreate: "true"
  • brickRootPaths: Bricks will be created under this directories.
  • volumeType: Storage class will create this type of volume.
  • namespace: Namespace which GlusterFS pods are consisted.
  • selector: Label selector which will specify GlusterFS pods.
  • forceCreate: If true, glusterd create volume forcefully.