Skip to content

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

  1. 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
  2. Run kubectl get pod to verify that one lvm-controller pod and the lvm-node DaemonSet are running. You may see additional pods depending on your setup.

    Terminal window
    kubectl get pod -n openebs
    NAME READY STATUS RESTARTS AGE
    openebs-localpv-provisioner-6bd66f8598-4zt77 1/1 Running 2 (8d ago) 26d
    openebs-lvm-localpv-controller-6bbd64786-pt2r7 5/5 Running 0 26d
    openebs-lvm-localpv-node-2bnd5 2/2 Running 0 26d
    openebs-lvm-localpv-node-7d2mg 2/2 Running 0 26d
    openebs-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.

  1. Run lvs to list all volumes and verify that you have lvm2 installed.

  2. Use vgcreate to 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 lvmvg volume group.

    Terminal window
    pvcreate /dev/sdb1
    pvcreate /dev/sdc1
    vgcreate lvmvg /dev/sdb1 /dev/sdc1
  3. Create a storage class with the provisioner field set to local.csi.openebs.io.

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
    name: openebs-lvmpv
    parameters:
    storage: "lvm"
    volgroup: "lvmvg"
    provisioner: local.csi.openebs.io
    volumeBindingMode: WaitForFirstConsumer
  4. Install an Aerospike cluster by setting storageClass to the storage class you created in the previous step so Kubernetes can provision a local volume PVC.

    volumes:
    - name: workdir
    aerospike:
    path: /opt/aerospike
    source:
    persistentVolume:
    storageClass: ssd
    volumeMode: Filesystem
    size: 1Gi
    - name: ns1
    aerospike:
    path: /test/dev/xvdf1
    source:
    persistentVolume:
    storageClass: openebs-lvmpv # Storage class name
    volumeMode: Block
    size: 5Gi

You should now have a working Aerospike cluster with OpenEBS-backed local storage.

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?