From 89ccbc8fbadf355ec7c31f486424ed8834bc3517 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sat, 6 Jul 2024 07:10:29 +0200 Subject: [PATCH] cephfs: support omap data store in radosnamespace via cli argument Signed-off-by: Andreas --- PendingReleaseNotes.md | 1 + cmd/cephcsi.go | 5 +++++ docs/deploy-cephfs.md | 1 + internal/cephfs/driver.go | 5 +++++ internal/cephfs/util/util.go | 6 ++---- internal/util/util.go | 6 +++--- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/PendingReleaseNotes.md b/PendingReleaseNotes.md index 98891f83b..7b4ccb452 100644 --- a/PendingReleaseNotes.md +++ b/PendingReleaseNotes.md @@ -8,5 +8,6 @@ - deploy: podSecurityContexts can be configured for ceph-csi-rbd chart in [PR](https://github.com/ceph/ceph-csi/pull/4668) - deploy: instanceID can be optionally configured for ceph-csi charts in [PR](https://github.com/ceph/ceph-csi/pull/4666) - rbd: add support for flattenMode option for replication in [PR](https://github.com/ceph/ceph-csi/pull/4678) +- cephfs: support omap data store in radosnamespace via cli argument in [PR](https://github.com/ceph/ceph-csi/pull/4652) ## NOTE diff --git a/cmd/cephcsi.go b/cmd/cephcsi.go index 88276a99f..9ef607be4 100644 --- a/cmd/cephcsi.go +++ b/cmd/cephcsi.go @@ -100,6 +100,11 @@ func init() { "kernelmountoptions", "", "Comma separated string of mount options accepted by cephfs kernel mounter") + flag.StringVar( + &conf.RadosNamespaceCephFS, + "radosnamespacecephfs", + "", + "CephFS RadosNamespace used to store CSI specific objects and keys.") flag.StringVar( &conf.FuseMountOptions, "fusemountoptions", diff --git a/docs/deploy-cephfs.md b/docs/deploy-cephfs.md index 89f1495ca..da798cbae 100644 --- a/docs/deploy-cephfs.md +++ b/docs/deploy-cephfs.md @@ -49,6 +49,7 @@ make image-cephcsi | `--domainlabels` | _empty_ | Kubernetes node labels to use as CSI domain labels for topology aware provisioning, should be a comma separated value (ex:= "failure-domain/region,failure-domain/zone") | | `--enable-read-affinity` | `false` | enable read affinity | | `--crush-location-labels`| _empty_ | Kubernetes node labels that determine the CRUSH location the node belongs to, separated by ','.
`Note: These labels will be replaced if crush location labels are defined in the ceph-csi-config ConfigMap for the specific cluster.` | +| `--radosnamespacecephfs`| _empty_ | CephFS RadosNamespace used to store CSI specific objects and keys. | **NOTE:** The parameter `-forcecephkernelclient` enables the Kernel CephFS mounter on kernels < 4.17. diff --git a/internal/cephfs/driver.go b/internal/cephfs/driver.go index dd78cf5c8..162b027ee 100644 --- a/internal/cephfs/driver.go +++ b/internal/cephfs/driver.go @@ -110,6 +110,11 @@ func (fs *Driver) Run(conf *util.Config) { CSIInstanceID = conf.InstanceID } + // Use passed in radosNamespace, if provided for storing CSI specific objects and keys. + if conf.RadosNamespaceCephFS != "" { + fsutil.RadosNamespace = conf.RadosNamespaceCephFS + } + if conf.IsNodeServer && k8s.RunsOnKubernetes() { nodeLabels, err = k8s.GetNodeLabels(conf.NodeID) if err != nil { diff --git a/internal/cephfs/util/util.go b/internal/cephfs/util/util.go index 02344d68c..5be4d8fa9 100644 --- a/internal/cephfs/util/util.go +++ b/internal/cephfs/util/util.go @@ -19,7 +19,5 @@ package util // VolumeID string representation. type VolumeID string -const ( - // RadosNamespace to store CSI specific objects and keys. - RadosNamespace = "csi" -) +// RadosNamespace to store CSI specific objects and keys. +var RadosNamespace = "csi" diff --git a/internal/util/util.go b/internal/util/util.go index 777458e5f..869df991b 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -142,9 +142,9 @@ type Config struct { SkipForceFlatten bool // cephfs related flags - ForceKernelCephFS bool // force to use the ceph kernel client even if the kernel is < 4.17 - - SetMetadata bool // set metadata on the volume + ForceKernelCephFS bool // force to use the ceph kernel client even if the kernel is < 4.17 + RadosNamespaceCephFS string // RadosNamespace used to store CSI specific objects and keys + SetMetadata bool // set metadata on the volume // Read affinity related options EnableReadAffinity bool // enable OSD read affinity.