Skip to content

Commit 8760c02

Browse files
committed
drenv: added new SC and Pool for RBD
Signed-off-by: rakeshgm <[email protected]>
1 parent acc70c7 commit 8760c02

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

test/addons/rook-pool/replica-pool.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
apiVersion: ceph.rook.io/v1
66
kind: CephBlockPool
77
metadata:
8-
name: replicapool
8+
name: $name
99
namespace: rook-ceph
1010
spec:
1111
replicated:

test/addons/rook-pool/start

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,28 @@ import yaml
1212
import drenv
1313
from drenv import kubectl
1414

15+
POOL_NAMES = ["replicapool", "replicapool-2"]
16+
1517

1618
def deploy(cluster):
19+
scs = [
20+
{"name": "rook-ceph-block", "pool": POOL_NAMES[0]},
21+
{"name": "rook-ceph-block-2", "pool": POOL_NAMES[1]},
22+
]
1723

1824
print("Creating StorageClass")
19-
template = drenv.template("storage-class.yaml")
20-
yaml = template.substitute(cluster=cluster)
21-
kubectl.apply("--filename=-", input=yaml, context=cluster)
25+
for sc in scs:
26+
template = drenv.template("storage-class.yaml")
27+
yaml = template.substitute(
28+
cluster=cluster, name=sc.get("name"), pool=sc.get("pool")
29+
)
30+
kubectl.apply("--filename=-", input=yaml, context=cluster)
2231

2332
print("Creating RBD pool")
24-
kubectl.apply("--filename=replica-pool.yaml", context=cluster)
33+
for pool in POOL_NAMES:
34+
template = drenv.template("replica-pool.yaml")
35+
yaml = template.substitute(cluster=cluster, name=pool)
36+
kubectl.apply("--filename=-", input=yaml, context=cluster)
2537

2638
print("Creating SnapshotClass")
2739
template = drenv.template("snapshot-class.yaml")

test/addons/rook-pool/storage-class.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
apiVersion: storage.k8s.io/v1
66
kind: StorageClass
77
metadata:
8-
name: rook-ceph-block
8+
name: $name
99
labels:
1010
ramendr.openshift.io/storageid: rook-ceph-$cluster-1
1111
provisioner: rook-ceph.rbd.csi.ceph.com
1212
parameters:
1313
clusterID: rook-ceph
14-
pool: replicapool
14+
pool: $pool
1515
imageFormat: "2"
1616
imageFeatures: layering
1717
csi.storage.k8s.io/provisioner-secret-name: rook-csi-rbd-provisioner

0 commit comments

Comments
 (0)