From 98732a50f8e1f80fa949c0924d1114ed3d390203 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 7 May 2024 20:02:15 +0200 Subject: [PATCH] docs: document how to have StorageClass consume Rados Namespace closes: https://github.com/rook/rook/issues/13214 Co-authored-by: Travis Nielsen Co-authored-by: Blaine Gardner Signed-off-by: Michael Adam (cherry picked from commit 8e7ac95f9747e926d483e860b9323e4748dde0ff) --- .../ceph-block-pool-rados-namespace-crd.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/CRDs/Block-Storage/ceph-block-pool-rados-namespace-crd.md b/Documentation/CRDs/Block-Storage/ceph-block-pool-rados-namespace-crd.md index 8be7f73b2215..4d169438f289 100644 --- a/Documentation/CRDs/Block-Storage/ceph-block-pool-rados-namespace-crd.md +++ b/Documentation/CRDs/Block-Storage/ceph-block-pool-rados-namespace-crd.md @@ -49,3 +49,35 @@ If any setting is unspecified, a suitable default will be used automatically. ### Spec - `blockPoolName`: The metadata name of the CephBlockPool CR where the rados namespace will be created. + +## Creating a Storage Class + +Once the RADOS namespace is created, an RBD-based StorageClass can be created to +create PVs in this RADOS namespace. For this purpose, the `clusterID` value from the +CephBlockPoolRadosNamespace status needs to be put into the `clusterID` field of the StorageClass +spec. + +Extract the clusterID from the CephBlockPoolRadosNamespace CR: + +```console +$ kubectl -n rook-ceph get cephblockpoolradosnamespace/namespace-a -o jsonpath='{.status.info.clusterID}' +80fc4f4bacc064be641633e6ed25ba7e +``` + +In this example, replace `namespace-a` by the actual name of the radosnamespace +created before. +Now set the `clusterID` retrieved from the previous step into the `clusterID` of the storage class. + +Example: + +```yaml +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: rook-ceph-block-rados-ns +provisioner: rook-ceph.rbd.csi.ceph.com # csi-provisioner-name +parameters: + clusterID: 80fc4f4bacc064be641633e6ed25ba7e + pool: replicapool + ... +```