diff --git a/test/addons/rook-pool/replica-pool.yaml b/test/addons/rook-pool/replica-pool.yaml index ba2e5a5ea..b7a617511 100644 --- a/test/addons/rook-pool/replica-pool.yaml +++ b/test/addons/rook-pool/replica-pool.yaml @@ -5,7 +5,7 @@ apiVersion: ceph.rook.io/v1 kind: CephBlockPool metadata: - name: replicapool + name: $name namespace: rook-ceph spec: replicated: diff --git a/test/addons/rook-pool/start b/test/addons/rook-pool/start index cf31e2878..53645b1e3 100755 --- a/test/addons/rook-pool/start +++ b/test/addons/rook-pool/start @@ -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") diff --git a/test/addons/rook-pool/storage-class.yaml b/test/addons/rook-pool/storage-class.yaml index bb4786d80..6ab40e0f8 100644 --- a/test/addons/rook-pool/storage-class.yaml +++ b/test/addons/rook-pool/storage-class.yaml @@ -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