Developer Solutions


Setting up OpenEBS with Kubernetes using Minikube

Minikube helps developers to quickly setup a single-node Kubernetes cluster for their development environment. There are several options available for developers to install Minikube. See, Minikube Setup.

If you are already an experienced Minikube user, you can easily setup OpenEBS on your existing Kubernetes cluster with a few simple kubectl commands. See, Quick Start.

This section provides instructions to set up Kubernetes using Minikube directly on Ubuntu 16.04 (without using any VM drivers) and to have OpenEBS running in hyperconverged mode.


Minimum requirements for using Minikube

  • Machine Type - (Minimum 4 vCPUs)
  • RAM - (Minimum 4 GB)

Make sure docker is installed on your Ubuntu host.

Installing Docker on Ubuntu

The following commands help you install Docker on Ubuntu version 16.04 (64 bit).

curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce

Add iSCSI Support

On your Ubuntu host, install open-iscsi package. OpenEBS uses iSCSI to connect to the block volumes.

sudo apt-get update
sudo apt-get install open-iscsi
sudo service open-iscsi restart

Verify that iSCSI is configured

Check that initiator name is configured and iSCSI service is running using the following commands.

sudo cat /etc/iscsi/initiatorname.iscsi
sudo service open-iscsi status

Download and setup Minikube and kubectl

On your Ubuntu host, install minikube.

curl -Lo minikube
chmod +x minikube
sudo mv minikube /usr/local/bin/

On your Ubuntu host, install kubectl.

curl -Lo kubectl$(curl -s
chmod +x kubectl
sudo mv kubectl /usr/local/bin/

On your Ubuntu host, setup directories for storing minkube and kubectl configuration.

mkdir $HOME/.kube || true
touch $HOME/.kube/config

On your Ubuntu host, setup the environment for minikube. Copy the following to ~/.profile.

export KUBECONFIG=$HOME/.kube/config

On your Ubuntu host, start minikube.

sudo -E minikube start --vm-driver=none

Verify that minikube is configured

Check that minikube is configured and it has started using the following commands.

minikube status

When minikube is configured properly, minikube status will display the following output:

minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at
  • If minikube status displays Stopped, add sudo minikube start command.
  • If minikube displays errors indicating permission denied to configuration files, fix the permissions by running the following commands.
sudo chown -R $USER $HOME/.kube
sudo chgrp -R $USER $HOME/.kube
sudo chown -R $USER $HOME/.minikube
sudo chgrp -R $USER $HOME/.minikube

Verify that Kubernetes is configured

Check that kubectl is configured and services are running using the following commands.

kubectl get pods
kubectl get nodes

When configured properly, the above kubectl commands will display output similar to following:

vagrant@minikube-dev:~$ kubectl get nodes
NAME           STATUS    AGE       VERSION
minikube-dev   Ready     8m        v1.7.5
vagrant@minikube-dev:~$ kubectl get pods --all-namespaces
NAMESPACE     NAME                              READY     STATUS    RESTARTS   AGE
kube-system   kube-addon-manager-minikube-dev   1/1       Running   1          8m
kube-system   kube-dns-910330662-4q4bm          3/3       Running   3          8m
kube-system   kubernetes-dashboard-txn8f        1/1       Running   1          8m

Setup OpenEBS

Download the latest OpenEBS Operator files using the following commands.

git clone
cd openebs/k8s
kubectl apply -f openebs-operator.yaml

Note By default, OpenEBS launches OpenEBS Volumes with two replicas. To set one replica, as is the case with single-node Kubernetes cluster, specify the environment variable OPENEBS_IO_JIVA_REPLICA_COUNT=1. If your OpenEBS version is < 0.5.0 you should use DEFAULT_REPLICA_COUNT environment variable instead of OPENEBS_IO_JIVA_REPLICA_COUNT.

The following snippet of the openebs-operator.yaml -> maya-apiserver section shows that how you should update it:

apiVersion: apps/v1beta1
kind: Deployment
  name: maya-apiserver
  namespace: default
  replicas: 1
        name: maya-apiserver
      serviceAccountName: openebs-maya-operator
      - name: maya-apiserver
        imagePullPolicy: Always
        image: openebs/m-apiserver:0.3-RC4
        - containerPort: 5656
          value: "1"

Add OpenEBS related storage classes, that can then be used by developers and applications using the following command.

kubectl apply -f openebs-storageclasses.yaml

Running Stateful Applications with OpenEBS Storage

To use OpenEBS as persistent storage for your stateful workloads, set the storage class in the Persistent Volume Claim (PVC) of your application to one of the OpenEBS storage class.

Get the list of storage classes using the following command. Choose the storage class that best suits your application.

kubectl get sc

Some sample YAML files for stateful workloads using OpenEBS are provided in the openebs/k8s/demo