-
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
Add a client/server implementation of the container runtime #13768
Comments
@kubernetes/rh-cluster-infra |
cc @thockin re. consistency and interaction with network and storage plugins |
We need two kinds of runtime abstractions in kubelet as of now - one for docker which operates at the container level, and another for rocket which operates at the pod level. Are we planning to expose both pod and container runtime plugins? |
I think we need to redefine the abstraction (container runtime interface) if we are going to expose it. We may need to ask Also, I am working a pod event generator (#12802) for kubelet's performance improvement, so I'd appreciate to be kept in the loop for related changes :) |
I think we should provides both pod-level and container-level api to work with kubelet. As you say, container runtime must be aware of the existence of pod, so apis like creating and deleting pod should be pod-level. But other apis like exec/logs/attach should be container-level since they operates directly on container. |
The upside of keeping a container-level api is that we can keep the majority of the logic in kubelet, which would reduce code duplication and maintenance overhead. /cc @yifan-gu for rkt. |
We currently have an exiting interface that both Docker and RKT implement. I'm suggesting a network client/server version of that interface. We can refactor/rewrite to our hearts content, but those refactors will just refactor the client/server interface also. --brendan |
+1 to the idea I don't see why we would keep any container-centric API. The abstraction On Wed, Sep 9, 2015 at 8:13 PM, Brendan Burns notifications@github.com
|
100% agree, the |
+1 for the direction. The core of the runtime interface is the Ideally container runtime should just implement |
Besides, i would suggest using grpc as
|
That's the interface I talked about, which was defined in a rush of time and needed to be polished (reiterated) more. I have filed issues before for that, and as @yifan-gu mentioned, even at pod-level abstraction there are many obvious imperfections. |
Not that I am against pod-level abstraction, but this alone is not the best argument IMO. We still have code (container garbage collection, image management, etc) bypassing the interface to talk to docker directly for direct container information. We should work out the requirements and fix the interface. |
+1 to this direction On Wednesday, September 9, 2015, Brendan Burns notifications@github.com
|
I notice there are three places talking directly to dockerclient out of runtime:
I suggest move For |
Yu-Ju, There's certainly leaks in the abstraction, but if you consider something The core of kubelet should only know about pods and abstract containers, I understand that this may not be the case right now :) On Thu, Sep 10, 2015 at 12:06 PM, Yu-Ju Hong notifications@github.com
|
Hmm...I wasn't actually advocating the container-level abstraction. I brought it up because @dchen1107 mentioned it the other day, and I thought it was worth throwing into the discussion :)
Agreed, but at the same time it seems like we want to have tighter control over disk space allocation and garbage collection, so the interface may not be as high-level as we want. |
Agreed. For now, the generic event in generator #13571 uses the runtime interface to support container runtimes that don't support container/pod event streams. It shouldn't be too hard to adapt that to the new interface, or to implement the client-server architecture. For container runtimes which do support container event streams, they can implement one on their own. |
@yujuhong By what I said I mean we might need to add pod level events. And in most of the time kubelet should only manage on pod level events. The container events should be handled by runtime according to the restartpolicy. However I tend to agree that container level events/interfaces are also necessary if we want to provide some fine grain introspection. (e.g. get per container's log, status, etc). Though I am trying to think if we can just include these in the pod level events/interfaces.. |
@yifan-gu, the current container events are packaged as pod-level events, even though they include some container information (ContainerStarted, etc). Having individual runtime handles all container-level events is a separate question though. If kubelet can fire and forget a pod without babysitting it, we may not even need pod-level events (other than maybe sending the pod status to the apiserver) :) |
@brendandburns Image manager refactored for client/server implementation of the container runtime. |
+1 for this. The mesos team is thinking of implementing a runtime for better integration with the mesos-native containerizer. |
I see some significant downsides to client/server, including more hops into the container for exec/attach/portforward scenarios. I do think that we should support a client/server containerizer, but for the foreseeable future I would want my containerizer compiled in if I was shipping a deployment. Conditionally compiled Kubelets provided with a particular host type (mesos, rocket, systemd+docker) has the same benefits without adding an extra hop. |
@smarterclayton inefficiency caused by client/server runtime is known. But please note that we didn't plan to make all container runtimes to use this model, and we do plan to continue supporting docker and rocket as Container Runtime as today, just with a better API. The only candidate we have today for this client / server model is hyper: |
@brendandburns I'm interested in whether |
On Tue, Oct 13, 2015 at 2:52 AM, Harry Zhang notifications@github.com
|
@vishh agreed. Actually, I am keeping a close eye on docker 1.9, which has the same intention. [update] moby/moby#14212 |
Automatic merge from submit-queue Proposal: client/server container runtime Ref #25899 #13768 Proposal for client/server container runtime CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
…er-proposal Automatic merge from submit-queue Proposal: client/server container runtime Ref kubernetes#25899 kubernetes#13768 Proposal for client/server container runtime CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
We already implemented CRI and using it by default in 1.6. Closing. |
Currently, any container runtime has to be linked into the kubelet. This makes experimentation difficult, and prevents users from landing an alternate container runtime without landing code in core kubernetes.
To facilitate experimentation and to enable user choice, we should add a client/server implementation of the container runtime interface.
This implementation will simply encode the requests, send them to a server where they will be decoded and sent into an instance of the container runtime interface.
However, this enables container runtime implementations to be built and maintained outside of the core kubernetes tree.
@dchen1107 @smarterclayton
@kubernetes/goog-node
The text was updated successfully, but these errors were encountered: