OpenEBS-backed local storage for Aerospike on Kubernetes
OpenEBS 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
kubectl get podto verify that onelvm-controllerpod and thelvm-nodeDaemonSet are running. You may see additional pods depending on your setup.Terminal window 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
lvsto list all volumes and verify that you havelvm2installed. -
Use
vgcreateto set up the volume group that the LVM driver uses to provision volumes.Run the following commands as a privileged user. This example creates two physical volumes and adds them to the
lvmvgvolume group.Terminal window pvcreate /dev/sdb1pvcreate /dev/sdc1vgcreate lvmvg /dev/sdb1 /dev/sdc1 -
Create a storage class with the
provisionerfield 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
storageClassto the storage class you created in the previous step so Kubernetes can 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 OpenEBS-backed local storage.