...
Before Rook can provision storage, a CephBlockPool
and StorageClass
and CephBlockPool
need to be created. This will allow Kubernetes to interoperate with Rook when provisioning PVs. So let's create these two components
Code Block |
---|
language | bash |
---|
title | SC and CephBlockPool |
---|
collapse | true |
---|
|
# The file, located in "rook/clusterdeploy/examples/kubernetes/ceph/csi/rbd", already contains both components
$ kubectl create -f storageclass.yaml |
Inside the same folder there are other files, including pod.yaml
and pvc.yaml
, useful for carrying out some quick tests. Of course the SC both components present in the storageclass.yaml
file can be modified according to your needs. Try . As for the first, you will find more details here. Instead for the second, try to test the behavior of the parameters seen in the Storage chapter, that is
Code Block |
---|
language | yml |
---|
title | SC parameters |
---|
collapse | true |
---|
|
allowVolumeExpansion: true # false (default) or true
volumeBindingMode: # Immediate # (default) or WaitForFirstConsumer
reclaimPolicy: # Delete (default) or Retain - Recycle not supported |
Since block storage allows a single pod to mount storage, only an accessMode
of type RWO (ReadWriteOnce) is allowed, when instantiating a PVC.
Teardown
To clean up all the artifacts created
Code Block |
---|
language | bash |
---|
title | Teardown |
---|
collapse | true |
---|
|
$ kubectl delete -f pod.yaml # Retain Or whatever the application used
$ kubectl delete -n rook-ceph cephblockpools.ceph.rook.io replicapool
$ kubectl delete storageclass rook-ceph-block |