Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new SC Names and Pools for Ceph-FS #1770

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/config.yaml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pvcspecs:
storageclassname: rook-ceph-block
accessmodes: ReadWriteOnce
- name: cephfs
storageclassname: rook-cephfs
storageclassname: rook-cephfs-test-fs1
accessmodes: ReadWriteMany
2 changes: 1 addition & 1 deletion test/addons/rook-cephfs/filesystem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
apiVersion: ceph.rook.io/v1
kind: CephFilesystem
metadata:
name: myfs
name: $name
namespace: rook-ceph
spec:
metadataPool:
Expand Down
1 change: 0 additions & 1 deletion test/addons/rook-cephfs/provision-test/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ namespace: drenv-addon-test

resources:
- namespace.yaml
- pvc.yaml
- snapshot.yaml
2 changes: 1 addition & 1 deletion test/addons/rook-cephfs/provision-test/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spec:
resources:
requests:
storage: 1Gi
storageClassName: rook-cephfs
storageClassName: rook-cephfs-$fsname
50 changes: 28 additions & 22 deletions test/addons/rook-cephfs/start
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import sys
import drenv
from drenv import kubectl

FILE_SYSTEMS = ["test-fs1", "test-fs2"]

def deploy(cluster):

print("Creating CephFS instance")
kubectl.apply("--filename=filesystem.yaml", context=cluster)
def deploy(cluster):
for file_system in FILE_SYSTEMS:
print("Creating CephFS instance")
template = drenv.template("filesystem.yaml")
yaml = template.substitute(cluster=cluster, name=file_system)
kubectl.apply("--filename=-", input=yaml, context=cluster)

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

print("Creating SnapshotClass")
template = drenv.template("snapshot-class.yaml")
Expand All @@ -27,21 +31,23 @@ def deploy(cluster):


def wait(cluster):
print("Waiting until CephFS is ready")
drenv.wait_for(
"cephfilesystem/myfs",
output="jsonpath={.status.phase}",
namespace="rook-ceph",
timeout=120,
profile=cluster,
)
kubectl.wait(
"cephfilesystem/myfs",
"--for=jsonpath={.status.phase}=Ready",
"--namespace=rook-ceph",
"--timeout=300s",
context=cluster,
)
print("Waiting until Ceph File Systems are ready")

for file_system in FILE_SYSTEMS:
drenv.wait_for(
f"cephfilesystem/{file_system}",
output="jsonpath={.status.phase}",
namespace="rook-ceph",
timeout=120,
profile=cluster,
)
kubectl.wait(
f"cephfilesystem/{file_system}",
"--for=jsonpath={.status.phase}=Ready",
"--namespace=rook-ceph",
"--timeout=300s",
context=cluster,
)


if len(sys.argv) != 2:
Expand Down
6 changes: 3 additions & 3 deletions test/addons/rook-cephfs/storage-class.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rook-cephfs
name: rook-cephfs-$fsname
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
fsName: $fsname
pool: $fsname-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
Expand Down
13 changes: 9 additions & 4 deletions test/addons/rook-cephfs/test
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,24 @@
import os
import sys

import drenv
from drenv import kubectl

PVC_NAME = "cephfs-pvc"
SNAP_NAME = "cephfs-snap"
NAMESPACE = "drenv-addon-test"
FILE_SYSTEMS = ["test-fs1", "test-fs2"]


def test_provisioning(cluster):
print(f"Deploying pvc and snapshot on cluster '{cluster}'")
print(f"Deploying snapshot and creating namespace on cluster '{cluster}'")
kubectl.apply("--kustomize", "provision-test", context=cluster)

print(f"Creating PVC {PVC_NAME} on cluster '{cluster}")
template = drenv.template("provision-test/pvc.yaml")
yaml = template.substitute(fsname=FILE_SYSTEMS[0])
kubectl.apply(
"--kustomize",
"provision-test",
context=cluster,
f"--namespace={NAMESPACE}", "--filename=-", input=yaml, context=cluster
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep the code as is, and modify the pvc to use "test-fs1"?


print(f"Waiting until pvc {PVC_NAME} is bound in cluster '{cluster}'")
Expand Down
2 changes: 1 addition & 1 deletion test/addons/volsync/app/file/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ patches:
patch: |-
- op: replace
path: /spec/storageClassName
value: rook-cephfs
value: rook-cephfs-test-fs1
- op: replace
path: /spec/accessModes
value:
Expand Down
4 changes: 2 additions & 2 deletions test/addons/volsync/rd/file/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ patches:
patch: |-
- op: replace
path: /spec/storageClassName
value: rook-cephfs
value: rook-cephfs-test-fs1
- op: replace
path: /spec/accessModes
value:
Expand All @@ -27,7 +27,7 @@ patches:
patch: |-
- op: replace
path: /spec/rsyncTLS/storageClassName
value: rook-cephfs
value: rook-cephfs-test-fs1
- op: replace
path: /spec/rsyncTLS/volumeSnapshotClassName
value: csi-cephfsplugin-snapclass
Loading