-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Prep for multiple kinds of volume plugins #5642
Conversation
Some additional context:
I prefer option 3 if only for packaging purposes. It will be nice to have just 1 place to define a volume and all its interfaces implemented. This maintains the idea of having an entirely self-contained volume that can be dropped in as a directory with no intimate knowledge of the plugin leaking outside that directory. More to come after I address the API feedback left for me yesterday and digest this PR more fully. |
3 doesn't sound terrible. All nfs code in one place benefits the extender because "copy-and-paste-extension" becomes much more obvious.
|
Is each new volume type really going to need a new implementation of all three interfaces? e.g. I would imagine that several different volume types would be mountable by a single common kubelet plugin based around *nix 'mount', perhaps? Similarly an iscsi-initiator based plugin might be able to mount volumes from multiple different storage vendors (NetApp, EMC etc), whereas the vendor interfaces for creation, deletion etc of volumes are mostly different (NetApp OnTAP, EMC Atmos etc). Let me go and read and digest Mark's PV and plugin stuff, after which I hope to be able to provide more intelligent input :-) |
@quinton-hoole I think you're right in that many volumes will mount similarly. We have a few people working on other storage plugins (iscsci and gluster, currently, and i've heard ceph bandied about). We've already agreed that we will likely find commonality among them and will take on the refactoring task of making them work well and adhere to whatever patterns we discover. |
Is each new volume type really going to need a new implementation of all three interfaces? e.g. I would imagine that several different volume types would be mountable by a single common kubelet plugin based around *nix 'mount', perhaps? Similarly an iscsi-initiator based plugin might be able to mount volumes from multiple different storage vendors (NetApp, EMC etc), whereas the vendor interfaces for creation, deletion etc of volumes are mostly different (NetApp OnTAP, EMC Atmos etc).
Volumes will choose to implement a subset of the interfaces. For
example, if we can restrict ourselves to two interfaces -
NodeVolumePlugin and PersistentVolumePlugin, there will be some
plugins (empty dir, secrets, hostpath) that only implement NodeVolume
and some (PD, NFS, iSCSI) that implement both Node and Persistent.
As for mount(), I think there is a common substrate around mount()
that has emerged and just needs to be extracted, but that is not the
plugin interface. The plugins are one step higher - iscsi, PD, NFS,
etc. They should be implemented in terms of the common mount() lib.
|
The move and rename LGTM. Also, "gore name" is the worst (or best) name for a Go extension. |
As a slight counter to my own proposal, which do you find least fugly? volume.{NodePlugin, NodeHost, NodeVolume, NodePluginMgr}, or volume.{Plugin, Host, Volume, PluginMgr}, volume.{PersistentPlugin, The latter leaves all of the node types "undecorated", since every volume I want to make this decision soon, polish off the PR, commit, and let you On Thu, Mar 19, 2015 at 12:15 PM, Mark Turansky notifications@github.com
|
4ddbc65
to
45bd7fc
Compare
+1 for the 3rd option. Although a bit tedious with naming, it makes it easy to manage all the plugins. As for |
@@ -261,8 +261,7 @@ func SimpleRunKubelet(client *client.Client, | |||
hostname, rootDir, manifestURL, address string, | |||
port uint, | |||
masterServiceNamespace string, | |||
volumePlugins []volume.Plugin, | |||
tlsOptions *kubelet.TLSOptions, | |||
volumePlugins []volume.NodePlugin, tlsOptions *kubelet.TLSOptions, |
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.
nit: Move tlsOptions *kubelet.TLSOptions,
to the next line
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.
not sure how that happened..
/sub |
45bd7fc
to
7060a53
Compare
As to your two choices above, I think I prefer the latter ("volume.{Plugin, Host, Volume, PluginMgr}, volume.{PersistentPlugin, PersistentHost, PersistentVolume, PersistentPluginMgr}") but I'll know with certainty when I start using it! |
updated PR is coming soon |
7060a53
to
ae6ff51
Compare
Third choice - it's more verbose but I think it is most consistent.
I'm pushing an updated PR with 2 commits. First commit is the minimal On Thu, Mar 19, 2015 at 1:36 PM, Mark Turansky notifications@github.com
|
I can take or leave the last commit. I sort of prefer it, so if nobody objects strongly, I'd say go with it. |
4f87a4c
to
73c0a02
Compare
LGTM. I like the 2nd commit because VolumePluginMgr (for example) is clearer than PluginMgr. Overall, the renames and moves make sense. If pkg/volume is now a top-level thing, does it make sense to move pkg/util/mount functionality to pkg/volume? |
Needs a rebase @thockin. LGTM otherwise. |
73c0a02
to
448e7d1
Compare
rebased @markturansky re: util/mount - I'd rather leave it as it's own thing - it's potentially useful and has no other kubernetes tie-ins (whcih is what util/ should be for IMO) |
Move pkg/kubelet/volume/... to pkg/volume/... Some renames to make the soon-to-come persistent volumes work clearer.
448e7d1
to
bfadae7
Compare
LGTM |
Prep for multiple kinds of volume plugins
With @markturansky adding persistent volumes, it becomes clear that volume plugins are needed in more than one kubernetes process. Specifically (at least, perhaps not complete):
Each of these needs different functionality from the plugin. I'm trying to balance the desire to have plugins be mostly opaque to the surrounding system with the desire to not have to sprinkle support for a given volume type all over the place.
Options that I saw:
Extend the existing volume.Interface to host a bunch of new methods. Downside is that all plugins (even those that will never support persistent volumes such as secrets) have to implement those functions (even just to panic). Would need to move pkg/kubelet/volume up to pkg/volume. Upside is simple.
Make 2 or 3 different plugin interfaces in 2 or 3 different pkg/something dirs. Downside is that adding a new volume type means creating 1, 2, or 3 new pkg dirs in various places in the codebase with related but not overlapping functionality. E.g. there would be 2 or 3 'nfs' packages implementing 2 or 3 different plugin interfaces. Upside is that the are cleanly factored.
Make 2 or 3 different plugin interfaces but put them all into a single pkg per volume type. Each caller would use a different entrypoint to the plugin pkg (ProbeNodeVolumePlugins, ProbePersistentVolumePlugins, etc). Downside is that naming gets clumsy. Upside is that all (e.g.) NFS code is in a single place, though each caller still needs to enumerate which plugins it supports.
I figured option 1 was right out. I preferred option 3 to option 2, so I implemented the basis for it. I don't HATE it, but I don't love it. I could be talked into option 2. I think we could limit option 2 to two places and 2 interfaces. Not so bad.
@markturansky @smarterclayton @bgrant0607 @vishh for smart opinions. This may set precedent for plugins that span the whole system, so I want to tread carefully.
This PR was mostly gorename.