glusterfs-client-provisioner

by Olli

Helm chartv1.0.2App v1.0.2Verified publisher

glusterfs-client-provisioner is an automatic provisioner that used your *already configured* GlusterFS cluster, automatically creating Persistent Volumes as subdirectories of the cluster.

About this chart

Kubernetes GlusterFS-Client Provisioner

GlusterFS subdir external provisioner is an automatic provisioner that use your existing and already configured GlusterFS volume to support dynamic provisioning of Kubernetes Persistent Volumes via Persistent Volume Claims. Persistent volumes are provisioned as subdirectories named ${namespace}-${pvcName}-${pvName}.

To note again, you must already have an GlusterFS cluster with a volume.

Unlike Heketi, which requires ssh access to the servers, this prosvisionner will use an existing GlusterFS volume, which allows you to manage it however you want, including adding new servers in the GlusterFS volume at any time.

This is a fork from NFS subdir external provisioner adapted to GlusterFS.

Requirements

Each node of the cluster needs the glusterfs-client package. On Ubuntu:

sudo add-apt-repository -y ppa:gluster/glusterfs-7
sudo apt install -y glusterfs-client

You can check how to create a cluster and a volume here: https://www.digitalocean.com/community/tutorials/how-to-create-a-redundant-storage-pool-using-glusterfs-on-ubuntu-18-04

About GlusterFS volumes

GlusterFS volumes work with endpoints, and currenlty kubernetes endpoints only support IP addresses. The support for hostnames is discussed but doesn't seem to be planned. GlusterFS is safer to run on local network only anyway.

Also endpoints in kubernetes are associated to services (which makes you wonder why GlusterFS volumes are using them), so orphan endpoints will be cleaned when the endpoints controller reboots (https://github.com/kubernetes/kubernetes/issues/12964). It is thus safer to create a service with the same name to avoid it.

Deploy with Helm

helm repository add olli-ai https://olli-ai.github.io/helm-charts/
helm install glusterfs-client olli-ai/glusterfs-client-provisioner \
    --namespace default \
    --set glusterfs.server='{x.x.x.x,y.y.y.y}' \
    --set glusterfs.volume=volume

You may prefer to have you own Endpoints, that you can update when changing the GlusterFS cluster.

echo <<<EOF | apply --namespace default -f -
kind: Endpoints
apiVersion: v1
metadata:
  name: my-endpoints
subsets:
- addresses:
  - ip: x.x.x.x
  ports:
  - port: 1 # the port has no impact
---
apiVersion: v1
kind: Service
metadata:
  name: my-endpoints
spec:
  ports: []
  clusterIP: None
  type: ClusterIP
EOF
helm repository add olli-ai https://olli-ai.github.io/helm-charts/
helm install glusterfs-client olli-ai/glusterfs-client-provisioner \
    --namespace default \
    --set endpoints.create=false \
    --set endpoints.name=my-endpoints \
    --set glusterfs.volume=volume
ParameterDescriptionDefault
replicaCountNumber of provisioner instances to deployed1
strategyTypeSpecifies the strategy used to replace old Pods by new onesRecreate
image.repositoryProvisioner imageolliai/glusterfs-client-provisioner
image.tagVersion of provisioner imageChart's version
image.pullPolicyImage pull policyIfNotPresent
storageClass.nameName of the storageClassglusterfs-client
storageClass.defaultClassSet as the default StorageClassfalse
storageClass.allowVolumeExpansionAllow expanding the volumetrue
storageClass.reclaimPolicyMethod used to reclaim an obsoleted volumeDelete
storageClass.provisionerNameName of the provisionerNameauto (cluster.local/{fullName})
storageClass.archiveOnDeleteArchive pvc when deletingfalse
storageClass.accessModesSet access mode for PVReadWriteOnce
glusterfs.serverIP of the GlusterFS servers (string or array)required if endpoints is not provided
glusterfs.volumeGlusteFS volume to mountrequired
glusterfs.pathBasepath of the mount point to be used/kubedata
glusterfs.mountOptionsMount optionsnull
endpoints.createShould we create an Enpoints resourcetrue
endpoints.createServiceShould we create an associated empty servicetrue
endpoints.nameName of the Enpoints resource to useauto if create, required else
endpoints.annotationsannotations for the endpoints{}
resourcesResources required (e.g. CPU, memory){}
rbac.createUse Role-based Access Controltrue
podSecurityPolicy.enabledCreate & use Pod Security Policy resourcesfalse
priorityClassNameSet pod priorityClassNamenull
serviceAccount.createShould we create a ServiceAccounttrue
serviceAccount.nameName of the ServiceAccount to useauto if create, required else
nodeSelectorNode labels for pod assignment{}
affinityAffinity settings{}
tolerationsList of node taints to tolerate[]
deployment.annotationsAnnotations for the deployment{}
pod.annotationsAnnotations for the pod{}

Deploy glusterfs-client-provisioner with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has glusterfs-client-provisioner on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartglusterfs-client-provisioner is pinned at v1.0.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply