Following are the steps to get started with OpenEBS on a Kubernetes cluster.
As a Kubernetes Operator/Administrator:
As a prerequisite, check if open-iscsi is installed and running on kubelet. See Steps for configuring and verifying open-iscsi.
You can install OpenEBS either through stable helm chart or by through OpenEBS helm chart or by using OpenEBS operator/kubectl.
Using a Stable Helm Chart:
Setup RBAC for helm tiller and install the chart from Kubernetes stable and deploy the storage class templates.
helm install --namespace openebs --name openebs -f https://openebs.github.io/charts/helm-values-0.6.0.yaml stable/openebs kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/v0.6/k8s/openebs-storageclasses.yaml
For more details on installing OpenEBS using helm, see install through helm.
Using OpenEBS Helm Charts
(Will be deprecated in the coming releases)
helm repo add openebs-charts https://openebs.github.io/charts/ helm repo update helm install openebs-charts/openebs
Using OpenEBS Operator (kubectl):
As a cluster admin, execute the following single command on the Kubernetes shell.
kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/v0.6/k8s/openebs-operator.yaml kubectl apply -f https://raw.githubusercontent.com/openebs/openebs/v0.6/k8s/openebs-storageclasses.yaml
Optional: Create a catalog of storage classes and publish them to your developers. A default storage class (openebs-standard) is added to the cluster when you install OpenEBS.
Optional: An OpenEBS enabled cluster can be imported into mayaonline.io for better visibility, volume management, and integrated ChatOps experience with Slack.
As an Application Developer:
Create a PVC specification with the right storage class and use it in the application YAML file. An example PVC specification is as follows.
application yaml contents volumes: - name: datadir persistentVolumeClaim: claimName: datadir volumeClaimTemplates: - metadata: name: datadir spec: storageClassName: openebs-cockroachdb accessModes: - "ReadWriteOnce" resources: requests: storage: 100G
Apply the YAML file using
kubectl apply -fcommand. Verify that an OpenEBS volume is provisioned and bound to the application pod.
Note: Because OpenEBS is a CAS, you will observe that new pods (one volume controller pod and as many volume replica PODs as the number of replicas configured in the storage class) are created.