OpenEBS
Overview
OpenEBS (Elastic Block Store) is an open-source platform that enables cloud-native, local or distributed persistent volume (PV) storage for Kubernetes. It is a platform-agnostic alternative to Amazon Elastic Block Store.
For more about OpenEBS, see the official OpenEBS documentation, particularly the Prerequisites.
Planning your deployment
OpenEBS supports several types of volumes. For Aerospike clusters, use Logical Volume Manager (LVM) local PV storage volumes. OpenEBS processes nodes with LVM set up on them to create storage pools, enabling dynamic storage allocation and aggregation across devices.
With an LVM local PV, Aerospike can create any number of persistent volume claims (PVCs). The aggregate size should be less than the size of the volume group.
Install OpenEBS with Helm
-
Run the following commands to install OpenEBS on your Kubernetes cluster with default settings.
Terminal window helm repo add openebs https://openebs.github.io/openebs \&& helm repo update \&& helm install openebs --namespace openebs openebs/openebs --set engines.replicated.mayastor.enabled=false --create-namespace -
Run
get pod
to see onelvm-controller
pod andlvm-node
daemonset running on the nodes. You may see more pods depending on your setup.% kubectl get pod -n openebsNAME READY STATUS RESTARTS AGEopenebs-localpv-provisioner-6bd66f8598-4zt77 1/1 Running 2 (8d ago) 26dopenebs-lvm-localpv-controller-6bbd64786-pt2r7 5/5 Running 0 26dopenebs-lvm-localpv-node-2bnd5 2/2 Running 0 26dopenebs-lvm-localpv-node-7d2mg 2/2 Running 0 26dopenebs-lvm-localpv-node-gz5wv 2/2 Running 0 26d
The OpenEBS installation documentation includes information about customizing these settings.
Set up an LVM local PV
The following steps guide you through a default setup process. See the OpenEBS LVM Installation documentation for a full list of options.
-
Run
lvs
to list all volumes and verify that you havelvm2
installed. -
Use
vgcreate
to set up a volume group that will be used by the LVM Driver for provisioning the volumes.The following example creates two volumes, then groups them into the
lvmvg
volume group.sudo pvcreate /dev/sdb1Physical volume "/dev/sdb1" successfully created.sudo pvcreate /dev/sdc1Physical volume "/dev/sdc1" successfully created.sudo vgcreate lvmvg /dev/sdb1 /dev/sdc1Volume group "lvmvg" successfully created -
Create a storage class with the
provisioner
field set tolocal.csi.openebs.io
.apiVersion: storage.k8s.io/v1kind: StorageClassmetadata:name: openebs-lvmpvparameters:storage: "lvm"volgroup: "lvmvg"provisioner: local.csi.openebs.iovolumeBindingMode: WaitForFirstConsumer -
Install an Aerospike cluster by setting
storageClass
to the storage class you set up in the previous step to provision a local volume PVC.volumes:- name: workdiraerospike:path: /opt/aerospikesource:persistentVolume:storageClass: ssdvolumeMode: Filesystemsize: 1Gi- name: ns1aerospike:path: /test/dev/xvdf1source:persistentVolume:storageClass: openebs-lvmpv # Storage class namevolumeMode: Blocksize: 5Gi
You should now have a working Aerospike cluster with an OpenEBS backed local storage.