-
Notifications
You must be signed in to change notification settings - Fork 373
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
Consider changing NodePublish to NodePrepare #96
Comments
I feel like we discussed this possibility early on, and eventually discarded it because some plugins will require fuse software or other non-kernel mounting protocols that we don't necessarily want to require the CO to know about. We also discussed the possibility of letting the plugin optionally do the mount, for cases where we just want to use a standard kernel mount, but I recall that we decided that would add more complexity to the flow than we wanted. So we settled on letting the plugin do the mount as the "least bad" option. |
As long as the mount struct can contain this, that's ok. To the CO it should be translating the returned mount(s) into a (or multiple) |
Fair enough. So if I understand it correctly, basically what you're saying is that the container runtime would always need to do a bind mount to consume the volume as the spec stands today. But the OCI runtime spec can take an array of any kind of mount (not just bind mounts). So:
|
Yep. |
Does that still require setting up mount propagation so that CO can see the mount by the SP? I am attaching my original email to the working group for some context why we choose the existing route:
|
This will be highly dependent on if the plugin will be performing any mounts that the CO needs to see. re: FUSE concerns This should still work. Having the CO do mounts provides more flexibility here since the SP can still do the mount(s) itself if required or can leave it to the CO to handle if at all possible. |
@cpuguy83 can you give a sample fuse workflow (in which CO does the mount) that does not depends on mount propagation? |
@jieyu I'm not sure there is one. In this case the SP would need to handle the root mount and the mount will need to be propagated back to the CO. |
@cpuguy83 that means CO has to support mount propagation anyway (for fuse). Given that, I'd prefer a more consistent way for handling mounts (what's specified in the spec). |
@jieyu What is inconsistent in this case? Either way a mount would still be returned which would contain the path where the data is stored. |
@cpuguy83 the inconsistency i was referring to was:
The mount propagation is setup by the CO when launching the plugin. For instance, you can mark the directory that contains |
FWIW I am in favor of this change. It will leave the overall process for fuse mounts largely unchanged, and will make kernel mounts considerably safer and better, since it won't require mounting into the container host namespace.
I also think that returning a mount specification instead of accepting a path dovetails nicely with the OCI runtime spec, so to me it is a bit more elegant.
It's kind of a big change to the spec, but better to do it now than later.
…---
Sent from VMware Boxer
On August 31, 2017 at 8:11:57 AM PDT, Brian Goff <[email protected]> wrote:
@jieyu<https://github.com/jieyu> What is inconsistent in this case? Either way a mount would still be returned which would contain the path where the data is stored.
Setting up mount propagation is up to the needs of the plugin. Not everything necessarily needs to mount (local storage) at all.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#96 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AIF0_HApH_ikBJ8WdNJzmEnmaQsoi0dwks5sdsyXgaJpZM4PHeHb>.
|
I think another reason that was discussed in the past is that some SP might want to rely on some existing mount utility programs (e.g., mount.nfs, mount.glusterfs ) to do the mount. If we ask CO to do the mount, then the SP can no longer use those existing mount utility programs. Also, I cross reference some relevant discussion in k8s community on this topic: cc @jsafrane |
There would not be anything stopping the SP from doing their own mount with
a mount helper, it just won't get the same level of safety as with allowing
the CO to do it.
Recommendation would be to have the CO do the mount(s), but we'd still
support SP mounts.
…On Thu, Aug 31, 2017 at 1:30 PM, Jie Yu ***@***.***> wrote:
I think another reason that was discussed in the past is that some SP
might want to rely on some existing mount utility programs (e.g.,
mount.nfs, mount.glusterfs ) to do the mount. If we ask CO to do the mount,
then the SP can no longer use those existing mount utility programs.
Also, I cross reference some relevant discussion in k8s community on this
topic:
kubernetes/community#589
<kubernetes/community#589>
cc @jsafrane <https://github.com/jsafrane>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAwxZon0o8KgwV6Cx0vOXFVUNO-yDnN1ks5sdu3PgaJpZM4PHeHb>
.
--
- Brian Goff
|
So one other thing here, and this probably complicates things but also allows a lot of flexibility (so forgive my Saturday afternoon rambling)... What if instead of just supporting a mount return type (although out of the gate, it should likely be limited to this), it was more open ended and could be extended (in the future) to pass other things such as, for example, a command or even (potentially) an image+command. |
@cpuguy83 What the CO should do in respond to those open ended things? |
@jieyu Determine what type of thing the SP said to run and run it if supported, error out if not supported. aciton := resp.GetAction() // go-grpc thing for getting a one of
switch action.(type) {
case MountAction:
// perform mount
default:
return ErrUnsupported
} |
#122 separates the responsibilities of publishing a device "globally" for the node, and publishing a volume on a per-workload basis |
This is a cool idea. We think we can add it in the future post v1 as a additive optional change. It would be a new capability on node. If capability exists, and CO recognizes it and wants to use it, CO can specify new field on NodePublishVolumeRequest to say it wants this, and SP can return a new field on NodePublishVolumeResponse with a bind mount struct that the CO can use to do the bind. |
Right now,
NodePublish
is used to instruct the storage driver to set everything up that's required for the node, get everything mounted, etc.One issue with this approach is we end up having to manage mounts in the runtime's mount namespace. Often this leads to leakages, difficulty in telling if something needs to be mounted or not, etc.
Instead we can change this to be more of a
Prepare
type statement where the SP does everything except mount and instead returns a mount struct (or list of mounts) which the caller would need to perform.This would allow passing the actual mount request to the container runtime to deal with (in the container's mount namespace even).
This also has the benefit that the SP does not need access to the mount target.
I'm not sure what would need to be returned for block storage here since nothing is mounted (maybe an mknod? this is platform dependent, maybe nothing at all is required), but I think there would still be benefit here.
Note that this is the approach being used for containerD storage drivers: https://godoc.org/github.com/containerd/containerd/snapshot#Snapshotter
The text was updated successfully, but these errors were encountered: