Skip to content

Commit

Permalink
drenv: added new SC and Pool for RBD
Browse files Browse the repository at this point in the history
Signed-off-by: rakeshgm <[email protected]>
  • Loading branch information
rakeshgm committed Jan 23, 2025
1 parent acc70c7 commit 8760c02
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/addons/rook-pool/replica-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
name: $name
namespace: rook-ceph
spec:
replicated:
Expand Down
20 changes: 16 additions & 4 deletions test/addons/rook-pool/start
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@ import yaml
import drenv
from drenv import kubectl

POOL_NAMES = ["replicapool", "replicapool-2"]


def deploy(cluster):
scs = [
{"name": "rook-ceph-block", "pool": POOL_NAMES[0]},
{"name": "rook-ceph-block-2", "pool": POOL_NAMES[1]},
]

print("Creating StorageClass")
template = drenv.template("storage-class.yaml")
yaml = template.substitute(cluster=cluster)
kubectl.apply("--filename=-", input=yaml, context=cluster)
for sc in scs:
template = drenv.template("storage-class.yaml")
yaml = template.substitute(
cluster=cluster, name=sc.get("name"), pool=sc.get("pool")
)
kubectl.apply("--filename=-", input=yaml, context=cluster)

print("Creating RBD pool")
kubectl.apply("--filename=replica-pool.yaml", context=cluster)
for pool in POOL_NAMES:
template = drenv.template("replica-pool.yaml")
yaml = template.substitute(cluster=cluster, name=pool)
kubectl.apply("--filename=-", input=yaml, context=cluster)

print("Creating SnapshotClass")
template = drenv.template("snapshot-class.yaml")
Expand Down
4 changes: 2 additions & 2 deletions test/addons/rook-pool/storage-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rook-ceph-block
name: $name
labels:
ramendr.openshift.io/storageid: rook-ceph-$cluster-1
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
clusterID: rook-ceph
pool: replicapool
pool: $pool
imageFormat: "2"
imageFeatures: layering
csi.storage.k8s.io/provisioner-secret-name: rook-csi-rbd-provisioner
Expand Down

0 comments on commit 8760c02

Please sign in to comment.