-
Notifications
You must be signed in to change notification settings - Fork 554
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 mount option for Cephfs #576
Conversation
examples/cephfs/storageclass.yaml
Outdated
@@ -20,6 +20,10 @@ parameters: | |||
# (optional) Ceph pool into which volume data shall be stored | |||
# pool: cephfs_data | |||
|
|||
# (optional) Comma seperated string of Cephfs kernel or ceph fuse | |||
# mount options. Check man mount.ceph for mount options. For eg: | |||
# mountOptions: readdir_max_bytes=1048576,norbytes |
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.
In line 41 there is an another mountOptions parameter. What's that for?
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.
that will be for binding mounting staging path to target path which will be used during node publish
pkg/cephfs/volumemounter.go
Outdated
@@ -128,6 +128,10 @@ func mountFuse(mountPoint string, cr *util.Credentials, volOptions *volumeOption | |||
args = append(args, "--client_mds_namespace="+volOptions.FsName) | |||
} | |||
|
|||
if volOptions.MountOptions != "" { | |||
args = append(args, volOptions.MountOptions) |
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.
wouldn't you have to append '-o'
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.
-o
is already present at line 124
examples/cephfs/storageclass.yaml
Outdated
@@ -20,6 +20,10 @@ parameters: | |||
# (optional) Ceph pool into which volume data shall be stored | |||
# pool: cephfs_data | |||
|
|||
# (optional) Comma seperated string of Cephfs kernel or ceph fuse |
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.
s/seperated/separated/
s/Cephfs kernel or ceph fuse mount options/CephFS kernel or FUSE mount options/
examples/cephfs/storageclass.yaml
Outdated
@@ -20,6 +20,10 @@ parameters: | |||
# (optional) Ceph pool into which volume data shall be stored | |||
# pool: cephfs_data | |||
|
|||
# (optional) Comma seperated string of Cephfs kernel or ceph fuse | |||
# mount options. Check man mount.ceph for mount options. For eg: |
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.
s/for mount options/for kernel mount options/
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.
For CephFS FUSE options check https://docs.ceph.com/docs/nautilus/man/8/ceph-fuse/
@poornimag is this PR still in WIP ? or you can remove it from the title. |
@poornimag is this tested? |
00bbfe4
to
a4bcdfa
Compare
@poornimag can you please revisit this PR? |
a4bcdfa
to
58e17c1
Compare
@poornimag looks like a spurious failure, retarted the CI, btw, is this still in WIP? |
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.
Why are we adding another mountOptions
field here? We should leverage req.GetVolumeCapability().GetMount().GetMountFlags()
that is already passed down from the storage class to add/append the same to the mount request. This is what is used in rbd for instance.
Unless the options to the fuse CephFS command (or kernel mount) are different than regular mount options, there should be no need to add an extra storage class key here to provide the same.
Reference Kubernetes PR: https://github.com/kubernetes/kubernetes/pull/67898
Am I missing something here?
@poornimag please rebase with latest changes |
@ShyamsundarR I think these options are specific to cephfs, not the filesystem mount options we use for mounting target path |
Different file systems will have different options, which are passed along using the mount options. In the case of CephFS it has its own mount options that maybe different than other file systems in use, but the manner of passing these should be via the standard CSI protocol rather than creating a separate option key in the storage class. Further the mount options are not specific to staging or target path, and should be used at an appropriate phase in the node operations. In the case of RBD, the options during mapping the image needs to come from a separate option key, as these are not mount time options, but other options when mounting the FS of choice on the device comes from mount options. We should remove the newly added options, and use what is provided by the protocol in this situation. |
58e17c1
to
e5c0538
Compare
So there are option like ro, noexec which makes sense only for bindfs, there are options specific to cephfs, how do we differentiate the options whether its for bind mount or ceph mount? isn't the mount options in SC are for the publish step, as in bindfs? |
cdb90da
to
6e39f65
Compare
The options specified are not bindfs specific but vfsoptions. The way forward looks to be,
The Further, current csi-cephfs code takes in all mount options from MountFlags and uses them during the bind mount, this works as options that are not recognized are dropped. This would need to change as well in this case. |
My suggestion would be |
It should be OK to pass kcephfs mount options with |
320d7c8
to
1eecce3
Compare
e78d6e7
to
10500c1
Compare
mount output from different pods: From the application pod: From the Nodeplugin pod: |
LGTM. @Madhu-1 PTAL. |
docs/deploy-cephfs.md
Outdated
@@ -79,6 +79,7 @@ is used to define in which namespace you want the configmaps to be stored | |||
| `fsName` | yes | CephFS filesystem name into which the volume shall be created | | |||
| `mounter` | no | Mount method to be used for this volume. Available options are `kernel` for Ceph kernel client and `fuse` for Ceph FUSE driver. Defaults to "default mounter", see command line arguments. | | |||
| `pool` | no | Ceph pool into which volume data shall be stored | | |||
| `mountOptions` | no | Comma seperated string of mount options accepted by cephfs kernel and/or fuse mount. by default no options are passed. Check man mount.ceph for options. | |
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.
@poornimag do we still need this one?
pkg/cephfs/volumemounter.go
Outdated
@@ -197,8 +198,13 @@ func mountKernel(ctx context.Context, mountPoint string, cr *util.Credentials, v | |||
if volOptions.FsName != "" { | |||
optionsStr += fmt.Sprintf(",mds_namespace=%s", volOptions.FsName) | |||
} | |||
if volOptions.MountOptions != "" { |
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.
what about mount options for ceph.fuse?
@poornimag may be I overlooked , actually whatever is the default SC option ( mountOptions) can be used for our purpose. We dont have to worry about whether its for Does it make sense? |
mount output from different pods: From the application pod: From the Nodeplugin pod:
The problem i see is, the options for ceph kernel, ceph fuse and bindfs are different. How do we differentiate which options are for which client mount? Eg: consider the "debug" mount option, the kernel mount fails if i specify debug But ceph-fuse succeeds for debug option and also bindfs: Now if i used the mount options in SC and debug is specified, and kernel >4.17 then the mount itself fails and hence binding fails. Also, ceph-fuse mount options [1] and kernel mount options [2] are different, i do not understand why this is the case, may be @ajarr can clarify this. eg dirstat is not recognized by fuse client: Because of the above cited reasons, have introduced another mountoption parameter, and that parameter is only passed for kernel mount(not fuse mount as there are not many options for ceph-fuse). [1] https://docs.ceph.com/docs/mimic/man/8/ceph-fuse/ |
@poornimag we should not worry about the mount options what the user specifies, even we cant validate it also, I think if it fails its user responsibility to provide proper mount options I believe |
sure, but one interesting fact here is that, the selection of mounter is from the plugin based on the kernel version ..etc, so user cannot upfront decide on what he has to supply. Documentation can help to an extent. One other choice would be specifying the For ex: mountOptions: Then we can parse it and use accordingly. May be not much optimal, but we can survive. Any thoughts? But @poornimag I completely accept or understand the difficulty to have a general solution here.!! just trying to pave the way somehow :) , Seperate |
am fine with documentation as the user knows the kernel version where he is deploying the cephcsi. |
I would like to summarise the outcome of a quick discussion ( @Madhu-1 , @poornimag ..) on this 👍 The proposal is to have 2 different parameters in SC for kernel and fuse mounters.
The is based on below possibilities. *) Different mounters can be selected by the plugin for PVCs created from same SC |
10500c1
to
f3cb0ce
Compare
Pull request has been modified.
# (optional) Comma seperated string of Cephfs kernel mount options. | ||
# Check man mount.ceph for mount options. For eg: | ||
# kernelMountOptions: readdir_max_bytes=1048576,norbytes | ||
|
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.
Also document what mountOptions
are. It's confusing. It's only for bindfs?
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.
I didn't get? You mean i need to define what mount options are? mount options are quite generic term, its also present in the storage class spec.
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.
I meant in line 45 there is an another mountOptions
. What's that for?
The storage class already takes MountOptions(MountFlags), these are the bind mount options. Some of these options may not be recognised by the cephfs mount. Hence added a new parameterin Storage Class for - cephfs kernel mount options, - ceph-fuse mount options Ceph kernel mount options are different from ceph-fuse options, hence added two different parameters. Signed-off-by: Poornima G <[email protected]>
f3cb0ce
to
c43d132
Compare
I think we are complicating this, failing to mount because of invalid mount options is acceptable. Like in the discussion Because we do not have a stricter mounter default, allowing that to appear in mount options in addition seems undesirable. Once we add extra keys/options in the storage class, removing them later would not be easy as this is deployed and used in multiple places. I strongly suggest we stick to the default mount options parameters and report failures if the mounter does not support them for the sysadmin to fix up the storage class or the mounter selection. |
Above discussion is different, its about, wrong supply from user, here the story is different, that said, as mentioned in earlier comments, mounter is different or picked by plugin at times and also mount options are not in parity..etc. One option which is actually correct for one mounter can be wrong for another mount.
I think thats where it adds flexibility.
If really required, we can do deprecation eventually with couple of releases in place. Thats fine. Also can be done by filling the
With all of above thoughts, I am fine with current approach. Approving this PR. |
Agreed with humble |
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.
LGTM
The storage class already takes MountOptions(MountFlags), these are the
bind mount options. Some of these options may not be recognised by the
cephfs mount. Hence added a new parameter in Storage Class for cephfs
kernel mount options. Ceph kernel mount options are different from
ceph-fuse options, and there are not many ceph-fuse options. Thus the
parameter takes only the ceph kernel mount options and ceph kernel mount
is choosen only when kernel is >=4.17.