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

Support storing cephfs omap in a different namespace in rados under same filesystem metadata pool #4652

Draft
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

zerotens
Copy link

Describe what this PR does

Fixes #4599

This PR adds a new cli argument to let users override the current hardcoded radosNamespace "csi" used in CephFS.

RadosNamespace = "csi"

Needed is this for multitenant environments where one ceph cluster with one cephfs filesystem is used by multiple kubernetes clusters.
This allows storing the state of every cephfs instance / kubernetes cluster in their own radosNamespaces and allows finer controlled access for cephfs.

This PR also makes those two needed parameters --instanceid (rbd & cephfs Helm Chart) and --radosnamespacecephfs (cephfs Helm Chart) configurable via helm chart.

Is there anything that requires special attention

Is the change backward compatible?

Yes

Are there concerns around backward compatibility?

No, the default values in code have not been changed but are now overrideable via helm and cli arguments.

Future concerns

Depending on future usage of the NFS Controller, currently the NFS controller is using the CephFS variables cephfs.CSIInstanceID and fsutil.RadosNamespace which is now overrideable with the cli argument --radosnamespacecephfs and --instanceid.

store.VolJournal = journal.NewCSIVolumeJournalWithNamespace(cephfs.CSIInstanceID, fsutil.RadosNamespace)

store.SnapJournal = journal.NewCSISnapshotJournalWithNamespace(cephfs.CSIInstanceID, fsutil.RadosNamespace)

j, err := store.VolJournal.Connect(nv.mons, fsutil.RadosNamespace, nv.cr)

j, err := store.VolJournal.Connect(nv.mons, fsutil.RadosNamespace, nv.cr)

Testing

As i don't have a nice way of testing it and this is my first PR and go code for some time i would appreciate an detailed review.

@zerotens zerotens changed the title Cephfs namespace Support storing cephfs omap in a different namespace in rados under same filesystem metadata pool May 30, 2024
@nixpanic nixpanic added component/cephfs Issues related to CephFS component/deployment Helm chart, kubernetes templates and configuration Issues/PRs labels May 31, 2024
Add cli argument --radosnamespacecephfs to override radosNamespace "csi" used to store CSI specific objects and keys.

Signed-off-by: Andreas <zerotens@users.noreply.github.com>
Add --instanceid / --radosnamespacecephfs for nfs component as it is also using these two variables from cephfs code.

Signed-off-by: Andreas <zerotens@users.noreply.github.com>
Add --radosnamespacecephfs cli argument to docs

Signed-off-by: Andreas <zerotens@users.noreply.github.com>
Add --radosnamespacecephfs cli argument to helm chart cephfs
Add --instance cli argument to helm chart cephfs and rbd

Signed-off-by: Andreas <zerotens@users.noreply.github.com>
@zerotens
Copy link
Author

@nixpanic Linting was hopefully fixed
/retest please

Comment on lines +61 to +63
{{- if .Values.instanceID }}
- "--instanceid={{ .Values.instanceID }}"
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

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

@zerotens
Can you please open another for instanceID change ?

Copy link
Author

Choose a reason for hiding this comment

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

@Rakshith-R
I made an extra PR for this.

#4666

@zerotens zerotens marked this pull request as draft June 5, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cephfs Issues related to CephFS component/deployment Helm chart, kubernetes templates and configuration Issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support storing cephfs omap in a different namespace in rados under same filesystem metadata pool
3 participants