Skip to content

Commit

Permalink
adding storageID and replicationID to classes
Browse files Browse the repository at this point in the history
add storageID, replicationID to StorageClass, replicationClasses
and snapshotClasses. this is to faciltate filtering of
multiple storageClasses

Signed-off-by: rakeshgm <[email protected]>
  • Loading branch information
rakeshgm committed Oct 30, 2024
1 parent 67f473d commit 2b8b3ac
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 24 deletions.
4 changes: 4 additions & 0 deletions test/addons/rbd-mirror/start
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def configure_rbd_mirroring(cluster, peer_info):
context=cluster,
)

template = drenv.template("vrc-sample.yaml")
yaml = template.substitute(cluster=cluster)
kubectl.apply("--filename=-", input=yaml, context=cluster)

print(f"Apply rbd mirror to cluster '{cluster}'")
kubectl.apply("--kustomize=start-data", context=cluster)

Expand Down
1 change: 0 additions & 1 deletion test/addons/rbd-mirror/start-data/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

---
resources:
- vrc-sample.yaml
- vgrc-sample.yaml
- rbd-mirror.yaml

Expand Down
3 changes: 3 additions & 0 deletions test/addons/rbd-mirror/start-data/vrc-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ apiVersion: replication.storage.openshift.io/v1alpha1
kind: VolumeReplicationClass
metadata:
name: vrc-sample
labels:
ramendr.openshift.io/storageid: rook-ceph-$cluster-1
ramendr.openshift.io/replicationid: rook-ceph-$cluster-1
spec:
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
Expand Down
10 changes: 0 additions & 10 deletions test/addons/rook-cephfs/cache

This file was deleted.

9 changes: 0 additions & 9 deletions test/addons/rook-cephfs/kustomization.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions test/addons/rook-cephfs/snapshot-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

# yamllint disable-line rule:line-length
# Source: https://raw.githubusercontent.com/rook/rook/release-1.15/deploy/examples/csi/cephfs/snapshotclass.yaml
# Modifications:
# - Added storageID and replicationID
---
apiVersion: snapshot.storage.k8s.io/v1
deletionPolicy: Delete
driver: rook-ceph.cephfs.csi.ceph.com
kind: VolumeSnapshotClass
metadata:
name: csi-cephfsplugin-snapclass
labels:
ramendr.openshift.io/storageid: rook-cephfs-$cluster-1
ramendr.openshift.io/replicationid: rook-cephfs-$cluster-1
parameters:
clusterID: rook-ceph
csi.storage.k8s.io/snapshotter-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/snapshotter-secret-namespace: rook-ceph
13 changes: 10 additions & 3 deletions test/addons/rook-cephfs/start
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ import os
import sys

import drenv
from drenv import cache
from drenv import kubectl


def deploy(cluster):
print("Creating CephFS instance and storage/snapshot classes")
path = cache.get(".", "addons/rook-cephfs-1.15.yaml")
kubectl.apply("--filename", path, context=cluster)

kubectl.apply("--filename=filesystem.yaml", context=cluster)

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

template = drenv.template("snapshot-class.yaml")
yaml = template.substitute(cluster=cluster)
kubectl.apply("--filename=-", input=yaml, context=cluster)


def wait(cluster):
Expand Down
27 changes: 27 additions & 0 deletions test/addons/rook-cephfs/storage-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

# yamllint disable-line rule:line-length
# Source: https://raw.githubusercontent.com/rook/rook/release-1.15/deploy/examples/csi/cephfs/storageclass.yaml
# Modifications:
# - Added storageID and replicationID
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rook-cephfs
labels:
ramendr.openshift.io/storageid: rook-cephfs-$cluster-1
provisioner: rook-ceph.cephfs.csi.ceph.com
parameters:
clusterID: rook-ceph
fsName: myfs
pool: myfs-replicated
csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
reclaimPolicy: Delete
allowVolumeExpansion: true
2 changes: 2 additions & 0 deletions test/addons/rook-pool/snapshot-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: csi-rbdplugin-snapclass
labels:
ramendr.openshift.io/storageid: rook-ceph-$cluster-1
driver: rook-ceph.rbd.csi.ceph.com
parameters:
clusterID: rook-ceph
Expand Down
5 changes: 4 additions & 1 deletion test/addons/rook-pool/start
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ def deploy(cluster):
kubectl.apply("--filename=-", input=yaml, context=cluster)
kubectl.apply(
"--filename=replica-pool.yaml",
"--filename=snapshot-class.yaml",
context=cluster,
)

template = drenv.template("snapshot-class.yaml")
yaml = template.substitute(cluster=cluster)
kubectl.apply("--filename=-", input=yaml, context=cluster)


def wait(cluster):
print("Waiting until ceph block pool is ready")
Expand Down

0 comments on commit 2b8b3ac

Please sign in to comment.