Giter Site home page Giter Site logo

glusterpv-provisioner's Introduction

GlusterPV-Provisioner

Kubernetes Persistent volume Provisioner for GlusterFS.

A simple shell script in 100 line of bash to watch the Kubernetes API for Pending Persistent Volume Claims, then create the wanted volume on the GlusterFS cluster and finally submit the Persistent Volume to Kubernetes.

This service is made to run on your external GlusterFS cluster (or single server) but you can embed it in your Docker Gluster's container to enable Auto-PV creation within your Kubernetes cluster.

Require

To run this service you will need the following packages :

jq
kubectl
glusterfs-server

And a running GlusterFS cluster (or single node). You can follow this link to achieve this point if you need a tutorial.

Installation

# Run on one of your Gluster server
mkdir -p /srv/scripts
cd /opt/
git clone [email protected]:valentin2105/GlusterPV-Provisioner.git
chmod +x GlusterPV-Provisioner/gluster-pv.sh
cp GlusterPV-Provisioner/gluster-pv.sh /srv/scripts/
cp GlusterPV-Provisioner/gluster-pv.service /etc/systemd/system/

# Edit the script to match your cluster config (IP, kubeconfig Path)
vim /srv/scripts/gluster-pv.sh

# Launch the service
systemctl daemon-reload
service gluster-pv start
journactl -u gluster-pv -f

When the service run, simply install a Helm Chart the requiere some PVs, and GlusterPV-Provisioner will create them for you.

Configuration

The configuration is in the first lines of the script :

#!/bin/bash

# a mandatory name to identify your Gluster server       
glusterName='glusterfs-cluster'   

# the IP where Kubernetes will mount your Gluster volume (for H/A use a shared IP) 
glusterEP='192.168.42.42'         

# the path of all nodes in your Gluster cluster (use just one in a single-node context)
glusterClusterPath='192.168.42.42:/gluster-pool 192.168.42.43:/gluster-pool' 

# the total node Number (number of replicas for your volume) 
glusterNodesNumber=2

# the path of the kubeconfig file 
kubeConfigPath=/root/.kube/config

Future

I'm currently working to rewrite this in Golang, if someone want help, it would be awesome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.