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 helm or by using OpenEBS operator
Setup RBAC for helm tiller and install the chart from Kubernetes stable and deploy the storage class templates
helm install stable/openebs --name openebs --namespace openebs
kubectl apply -f https://github.com/openebs/openebs/blob/master/k8s/openebs-storageclasses.yaml
For more details on installing OpenEBS using helm, see install through helm
Using OpenEBS operator:
As a cluster admin, execute the following single command on the Kubernetes shell
kubectl apply -f https://openebs.github.io/charts/openebs-operator.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, manageability of volumes 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. Example PVC spec is shown below
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 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