Creating storage pools

In this recipe, we will use raw block devices attached to your nodes to create a storage pool. These devices can be AWS EBS volumes, GCP PDs, Azure Disk, virtual disks, or vSAN volumes. Devices can be attached to your worker node VMs, or basically physical disks if you are using a bare-metal Kubernetes cluster. Let's perform the following steps to create a storage pool out of raw block devices:

  1. List unused and unclaimed block devices on your nodes:
$ kubectl get blockdevices -n openebs
NAME NODENAME SIZE CLAIMSTATE STATUS AGE
blockdevice-24d9b7652893384a36d0cc34a804c60c ip-172-23-1-176.us-west-2.compute.internal 107374182400 Unclaimed Active 52s
blockdevice-8ef1fd7e30cf0667476dba97975d5ac9 ip-172-23-1-25.us-west-2.compute.internal 107374182400 Unclaimed Active 51s
blockdevice-94e7c768ef098a74f3e2c7fed6d82a5f ip-172-23-1-253.us-west-2.compute.internal 107374182400 Unclaimed Active 52s

In our example, we have a three-node Kubernetes cluster on AWS EC2 with one additional EBS volume attached to each node.

  1. Create a storage pool using the unclaimed devices from Step 1:
$ cat <<EOF | kubectl apply -f -
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-disk-pool
annotations:
cas.openebs.io/config: |
- name: PoolResourceRequests
value: |-
memory: 2Gi
- name: PoolResourceLimits
value: |-
memory: 4Gi
spec:
name: cstor-disk-pool
type: disk
poolSpec:
poolType: striped
blockDevices:
blockDeviceList:
- blockdevice-24d9b7652893384a36d0cc34a804c60c
- blockdevice-8ef1fd7e30cf0667476dba97975d5ac9
- blockdevice-94e7c768ef098a74f3e2c7fed6d82a5f
EOF
  1. List the storage pool claims:
$ kubectl get spc
NAME AGE
cstor-disk-pool 29s
  1. Verify that a cStor pool has been created and that its status is Healthy:
$ kubectl get csp
NAME ALLOCATED FREE CAPACITY STATUS TYPE AGE
cstor-disk-pool-8fnp 270K 99.5G 99.5G Healthy striped 3m9s
cstor-disk-pool-nsy6 270K 99.5G 99.5G Healthy striped 3m9s
cstor-disk-pool-v6ue 270K 99.5G 99.5G Healthy striped 3m10s
  1. Now we can use the storage pool in storage classes to provision dynamic volumes.
..................Content has been hidden....................

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