Creating OpenEBS storage classes

Let's perform the following steps to create a new storage class to consume StoragePool, which we created previously in the Creating storage pools recipe:

  1. Create an OpenEBS cStor storage class using the cStor StoragePoolClaim name, cstor-disk-pool, with three replicas:
$ cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-cstor-default
annotations:
openebs.io/cas-type: cstor
cas.openebs.io/config: |
- name: StoragePoolClaim
value: "cstor-disk-pool"
- name: ReplicaCount
value: "3"
provisioner: openebs.io/provisioner-iscsi
EOF
  1. List the storage classes:
$ kubectl get sc
NAME PROVISIONER AGE
default kubernetes.io/aws-ebs 25m
gp2 (default) kubernetes.io/aws-ebs 25m
openebs-cstor-default openebs.io/provisioner-iscsi 6s
openebs-device openebs.io/local 20m
openebs-hostpath openebs.io/local 20m
openebs-jiva-default openebs.io/provisioner-iscsi 20m
openebs-snapshot-promoter volumesnapshot.external-storage.k8s.io/snapshot-promoter 20m
ubun
  1. Set the gp2 AWS EBS storage class as the non-default option:
$ kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.beta.kubernetes.io/is-default-class":"false"}}}'
  1. Define openebs-cstor-default as the default storage class:
$ kubectl patch storageclass openebs-cstor-default -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

Make sure that the previous storage class is no longer set as the default and that you only have one default storage class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.104.124