Purpose
This guide illustrates the procedure to deploy and configure OpenEBS for Kubernetes (RKE2 or K3s). OpenEBS can be used as local storage.
As mentioned on OpenEBS site (https://openebs.io/docs), the the top reasons towards using OpenEBS as:
- OpenEBS provides consistency across all Kubernetes distributions – On-premise and Cloud.
- OpenEBS with Kubernetes increases Developer and Platform SRE Productivity.
- OpenEBS is Easy to use compared to other solutions, for e.g. trivial to install & enabling entirely dynamic provisioning.
- OpenEBS has Excellent Community Support.
- OpenEBS is completely Open Source and Free.
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"}}}'
Leave a Reply