-
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
kubelet: add a generic pod lifecycle event generator #13571
Conversation
1af11a8
to
28834f7
Compare
Labelling this PR as size/L |
This is part of #12802 to improve kubelet's performance. I decided to split #12829 in to a few parts for easier reviewing. The plan is to
This PR does (1), and I am working on (2). Other parallel tasks to reduce sync period includes:
What to expect from this PR:
|
cc @kubernetes/goog-node |
// Returns a channel from which the subscriber can recieve PodLifecycleEvent | ||
// events. | ||
func (g *GenericPLEG) Watch() chan *PodLifecycleEvent { | ||
return g.eventChannel |
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.
With a single channel, it means only a single component can be listening to the PLEs, right? It would be useful for the ProbeManager (work in progress by me) to be able to listen for the Container{Started,Stopped} events. What if each call to Watch created a new channel, which the "main" channel cloned events into? It would add a bit more complexity around the bookkeeping of closing channels & preventing channels from backing up though.
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.
Yes, I had a TODO to extend this to multiple channels, but it's still a TODO :)
I think multi-channel support can wait a little bit, and help is always welcome.
28834f7
to
bd813c8
Compare
Rebased and a friendly ping. |
50ed15d
to
17932c3
Compare
return f.PodList, f.Err | ||
if all { | ||
return f.AllPodList, f.Err | ||
} else { |
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.
unnecessary else
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.
Removed.
95d113b
to
e6c19ec
Compare
GCE e2e build/test failed for commit ac778e8. |
@k8s-bot test this please |
GCE e2e build/test failed for commit ac778e8. |
@k8s-bot test this please |
GCE e2e test build/test passed for commit ac778e8. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test failed for commit ac778e8. |
@k8s-bot e2e test this please |
GCE e2e build/test failed for commit ac778e8. |
@k8s-bot test this |
GCE e2e test build/test passed for commit ac778e8. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test failed for commit ac778e8. |
@k8s-bot test this |
GCE e2e test build/test passed for commit ac778e8. |
FYI, I checked the failed test in build, where |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit ac778e8. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
kubelet: add a generic pod lifecycle event generator
@yujuhong is there a PR on having kubelet using the docker event stream instead of polling? |
Nope. It wasn't prioritized for v1.3, so no one is actively working on it. Also, it'd need most likely more than one PR:
|
This change introduces pod lifecycle event generator (PLEG), and adds a generic
PLEG. The generic PLEG relies on relisting to discover container events, and is
container-runtime-agnostic. Both docker and rkt are changed to use generic
PLEG.