OpenEBS Local Storage Solution
Pre-Requisites for OpenEBS
OpenEBS (Open Elastic Block Storage) an open source containerized storage solution. We will be deploying OpenEBS local Persistent Volume backed by Hostpath.
Setup the directory on the nodes where Local PV Hostpaths will be created. This directory will be referred to as BasePath
. The default location is /var/openebs/local
.
BasePath
can be any of the following:
- A directory on root disk (or
os disk
). (Example:/var/openebs/local
). - In the case of cloud or virtual instances, a mounted directory created from attaching an external cloud volume or virtual disk. (Example, in GKE, a Local SSD can be used which will be available at
/mnt/disk/ssd1
.)
Installation Options
The installation can be done either using kubectl or helm
1. Install Using kubectl
To install using kubectl, run the following command:
kubectl apply -f https://openebs.github.io/charts/openebs-operator.yaml
OR
1. Install Using helm
Installation can also be done via helm. Run the following command
helm repo add openebs https://openebs.github.io/charts
helm repo update
helm install --namespace openebs --name openebs openebs/openebs
Finalization Steps
1. Once installation is complete, verify the pods are up and running using the following command:
helm install openebs --namespace openebs openebs/openebs --create-namespace
2. See the default storage class is created with base path
kubectl get sc
3. Make the storage class as default, replace <name> with your storage class name from above command.
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'