-
Notifications
You must be signed in to change notification settings - Fork 555
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
CephFS: support omap data store in radosnamespace #4661
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b28e52f
deploy: add RadosNamespace field for CephFS
iPraveenParihar f30213f
util: add GetCephFSRadosNamespace method
iPraveenParihar d9df0b4
cephfs: support omap store in radosnamespace
iPraveenParihar c17933c
e2e: cephfs rados namespace test
iPraveenParihar a27feb9
helm: add example for cephFS radosnamespace
iPraveenParihar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2491,6 +2491,122 @@ var _ = Describe(cephfsType, func() { | |
} | ||
}) | ||
|
||
By("verify rados objects are within a namespace", func() { | ||
updateRadosNamespace := func(radosNamespaceName string) { | ||
framework.Logf("updating configmap with rados namespace %s", radosNamespace) | ||
radosNamespace = radosNamespaceName | ||
err := deleteConfigMap(cephFSDirPath) | ||
if err != nil { | ||
framework.Failf("failed to delete configmap:: %v", err) | ||
} | ||
err = createConfigMap(cephFSDirPath, f.ClientSet, f) | ||
if err != nil { | ||
framework.Failf("failed to create configmap: %v", err) | ||
} | ||
|
||
// delete csi pods | ||
err = deletePodWithLabel("app in (ceph-csi-cephfs, csi-cephfsplugin, csi-cephfsplugin-provisioner)", | ||
cephCSINamespace, false) | ||
if err != nil { | ||
framework.Failf("failed to delete pods with labels: %v", err) | ||
} | ||
// wait for csi pods to come up | ||
err = waitForDaemonSets(cephFSDeamonSetName, cephCSINamespace, f.ClientSet, deployTimeout) | ||
if err != nil { | ||
framework.Failf("timeout waiting for daemonset pods: %v", err) | ||
} | ||
err = waitForDeploymentComplete(f.ClientSet, cephFSDeploymentName, cephCSINamespace, deployTimeout) | ||
if err != nil { | ||
framework.Failf("timeout waiting for deployment pods: %v", err) | ||
} | ||
} | ||
|
||
// radosNamespace is a global variable, so we need to save the old value | ||
// and restore it after the test. | ||
oldRadosNamespace := radosNamespace | ||
newRadosNamespace := "cephfs-ns" | ||
|
||
updateRadosNamespace(newRadosNamespace) | ||
defer func() { | ||
updateRadosNamespace(oldRadosNamespace) | ||
}() | ||
|
||
err := deleteResource(cephFSExamplePath + "storageclass.yaml") | ||
if err != nil { | ||
framework.Failf("failed to delete CephFS storageclass: %v", err) | ||
} | ||
err = createCephfsStorageClass(f.ClientSet, f, true, nil) | ||
if err != nil { | ||
framework.Failf("failed to create CephFS storageclass: %v", err) | ||
} | ||
// create a PVC and bind it to an app | ||
pvc, pod, err := createPVCAndAppBinding(pvcPath, appPath, f, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to validate CephFS pvc and application binding: %v", err) | ||
} | ||
|
||
// snapshot test | ||
err = deleteResource(cephFSExamplePath + "snapshotclass.yaml") | ||
if err != nil { | ||
framework.Failf("failed to delete CephFS snapshotclass: %v", err) | ||
} | ||
err = createCephFSSnapshotClass(f) | ||
if err != nil { | ||
framework.Failf("failed to create CephFS snapshot class: %v", err) | ||
} | ||
snap := getSnapshot(snapshotPath) | ||
snap.Namespace = f.UniqueName | ||
snap.Spec.Source.PersistentVolumeClaimName = &pvc.Name | ||
snap.Name = f.UniqueName | ||
err = createSnapshot(&snap, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to create snapshot (%s): %v", snap.Name, err) | ||
} | ||
|
||
// restore pvc test | ||
pvcClone, err := loadPVC(pvcClonePath) | ||
if err != nil { | ||
framework.Failf("failed to load PVC: %v", err) | ||
} | ||
pvcClone.Namespace = f.UniqueName | ||
pvcClone.Spec.DataSource.Name = snap.Name | ||
// create PVC from the snapshot | ||
err = createPVCAndvalidatePV(f.ClientSet, pvcClone, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to create pvc clone: %v", err) | ||
} | ||
|
||
// validate OMAP count | ||
validateOmapCount(f, 2, cephfsType, metadataPool, volumesType) | ||
validateOmapCount(f, 1, cephfsType, metadataPool, snapsType) | ||
|
||
// delete resources | ||
err = deletePod(pod.Name, pod.Namespace, f.ClientSet, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to delete application: %v", err) | ||
} | ||
err = deletePVCAndValidatePV(f.ClientSet, pvc, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to delete PVC: %v", err) | ||
} | ||
err = deletePVCAndValidatePV(f.ClientSet, pvcClone, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to delete pvc clone: %v", err) | ||
} | ||
err = deleteSnapshot(&snap, deployTimeout) | ||
if err != nil { | ||
framework.Failf("failed to delete snapshot (%s): %v", f.UniqueName, err) | ||
} | ||
err = deleteResource(cephFSExamplePath + "storageclass.yaml") | ||
if err != nil { | ||
framework.Failf("failed to delete CephFS storageclass: %v", err) | ||
} | ||
Comment on lines
+2600
to
+2603
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not required as storageclass is already deleted above |
||
|
||
// validate OMAP count | ||
validateOmapCount(f, 0, cephfsType, metadataPool, volumesType) | ||
validateOmapCount(f, 0, cephfsType, metadataPool, snapsType) | ||
}) | ||
|
||
// FIXME: in case NFS testing is done, prevent deletion | ||
// of the CephFS filesystem and related pool. This can | ||
// probably be addressed in a nicer way, making sure | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a test for snapshot and Restore pvc as well as we will use this new radosnamespace for metadata as well.