-
Notifications
You must be signed in to change notification settings - Fork 883
Event stream support for rkt #1193
Comments
What events would you like to see? This is the list docker has: https://docs.docker.com/reference/api/docker_remote_api_v1.17/#monitor-docker-s-events Most of these events are things that an init system does like notify you of process start, stop, etc events. If you are launching rkt containers under systemd you can get start/stop events via the systemd API. For example you could use this Go systemd API to get all changed state units from systemd: |
@yujuhong The use case is for |
@philips, I'd like to see rkt support a pod lifecycle event stream. To give you more background (as @yifan-gu pointed out), I am exploring options to restructure kubelet for better performance and scale. In kubernetes, kubelet is a daemon that manages containers on the node. Kubelet uses a pod abstraction, exposed through a container runtime interface that straddles both docker and rkt.
This means a lot of the complexity is pushed down into the container runtime interface, while kubelet sits around poll-listing containers. Hence the latency of kubelet is predicated by the runtime's list/inspect performance, making it difficult to profile, optimize and reason about concurrently. I'm trying to scope out if there is interest in supporting a pod (or container) event stream, and if there is, where it should live. Implementing a watch on systemd for rkt alone seems like a step in the wrong direction IMHO. |
Any updates on this one? |
Chatted with @yujuhong offline, and she proposed another option to achieve this by using cAdvisor event stream. |
To expand on this, we have two options for event stream as of now:
The former requires rkt to support event stream, but would provide richer event set for kubelet to consume. The latter requires cadvisor to support rkt, and provides only basic container events (start/termination). However, since Kubelet relies on cadvisor for resource monitoring, etc, it might be good for the long run if cadvisor can support rkt fullly. We'd appreciate if the rkt team can help with either option :-) |
@dchen1107 @yujuhong I am glad to help integrate with the cadvisor in short term. In longer term we are planning to provide an API for such things, as well as pod creation, image pulling, etc. |
I added a reference to this issue on systemd/systemd#1369 about EVENT_TYPE_APP_STARTED and EVENT_TYPE_APP_EXITED. Was the communication mechanism between the api service and the container decided/implemented? |
@alban Not yet. |
#1696 should go first before this issue. |
@yifan-gu what is the status on this? |
@alban Will try to come up with a design doc. |
@alban Still debugging network issues. Haven't worked on this today. |
Filed the issue in systemd to help rkt facilitate this feature systemd#3726 |
Docker has a watch feature to serve real-time events stream through /events. This is a nice feature to eliminate frequent polling. Is there any plan for rkt to support similar watch function? For example, rkt can use inotify to watch sysfs...
/cc @yifan-gu
The text was updated successfully, but these errors were encountered: