Skip to content

Commit

Permalink
drenv: added new SC and Pool for RBD
Browse files Browse the repository at this point in the history
This commit adds a new storage class and pool for RBD, which allows the
ramen code base to exercise the filtering logic when there are multiple
storage classes in the environment. This also prepares the environment
for scenarios where more than two workloads use different storage
classes.

Signed-off-by: rakeshgm <[email protected]>
  • Loading branch information
rakeshgm committed Jan 24, 2025
1 parent acc70c7 commit 56f26f0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 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
28 changes: 20 additions & 8 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):

print("Creating StorageClass")
template = drenv.template("storage-class.yaml")
yaml = template.substitute(cluster=cluster)
kubectl.apply("--filename=-", input=yaml, context=cluster)

print("Creating RBD pool")
kubectl.apply("--filename=replica-pool.yaml", context=cluster)
def deploy(cluster):
storage_classes = [
{"name": "rook-ceph-block", "pool": POOL_NAMES[0]},
{"name": "rook-ceph-block-2", "pool": POOL_NAMES[1]},
]

print("Creating StorageClasses")
for storage_class in storage_classes:
template = drenv.template("storage-class.yaml")
yaml = template.substitute(
cluster=cluster, name=storage_class["name"], pool=storage_class["pool"]
)
kubectl.apply("--filename=-", input=yaml, context=cluster)

print("Creating RBD pools")
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 56f26f0

Please sign in to comment.