Define ComponentPlugin API type

Just writing down how I think plugins should get registered with the system. Was thinking it'd be nice to do the event thing as a plugin.


> On Sep 19, 2014, at 1:22 PM, Daniel Smith <notifications@github.com> wrote:
> 
> In docs/plugin-component.md:
> 
> > +Q. This makes the system hard to reason about.
> > +A. Well, it makes each piece easy to reason about. When reasoning about the system as a whole, one should look at our (future) config setup. Clusters being complex is going to happen no matter what, we might as well do it with understandable pieces.
> > +
> > +Q. Why run a component plugin from a replication controller?
> > +A. This allows scaling and ensures that your plugin will be restarted if it crashes or the minion it's on dies, etc..
> > +
> > +Q. Why require a service? Why not just an arbitrary endpoint?
> > +A. If you're running as a k8s component behind a replication controller, there's really no other way to identify your current location, at least not currently. We might reevaluate this when IP-per-service is implemented.
> > +
> > +Q. What if a plugin wants to handle multiple api endpoints?
> > +A. Put multiple ComponentPlugin objects into the system.
> > +
> > +Q. How do component plugins store their stuff?
> > +A. Choices:
> > + a. We could make them just deal with it.
> > + b. We could allow them to delegate storage to our apiserver. E.g., we allow the plugin (but no one else) to use the path "/api/v1beta1/delegatedStorage/<pluginID>[/objectname]" to POST/PUT/GET/DELETE and watch objects.
> I was thinking that the stored objects have independent lifetime from the plugin itself-- you'd have to explicitly delete them if you want them to go away.
> 
> Issue with reusing same backend, although I agree it's much simpler, is security. I guess if etcd let us put ACLs on directories we could do that? Hm. I think that may be my new favorite choice.
> 
Although the delegation I think has legs once we stabilize API server, indexing, and our query patterns.