Skip to content
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

Kubernetes pod queueing #3

Open
cioc opened this issue Aug 10, 2016 · 1 comment
Open

Kubernetes pod queueing #3

cioc opened this issue Aug 10, 2016 · 1 comment
Assignees
Labels

Comments

@cioc
Copy link
Collaborator

cioc commented Aug 10, 2016

Investigate how kubernetes queues pod requests.

@cioc cioc self-assigned this Aug 10, 2016
@cioc
Copy link
Collaborator Author

cioc commented Aug 10, 2016

Overall, yes there is queuing, but no, don't depend on ordering. The backing store is etcd and we rely on their watching mechanism at the lowest level.

Queueing is implied via the scheduler docs, " Its interface to the API server is to watch for Pods with an empty PodSpec.NodeName, and for each Pod, it posts a Binding indicating where the Pod should be scheduled. ... The scheduler tries to find a node for each Pod, one at a time, as it notices these Pods via watch." So, the queueing mechanism is kind of the pod meta data system.

https://github.com/kubernetes/kubernetes/blob/b829d4d4ef68e64b9b7ae42b46877ee75bb2bfd9/docs/devel/scheduler.md

Here is the queue that feeds the scheduler:

https://github.com/kubernetes/kubernetes/blob/1c5af3e72feb00cf6510c8c10abb991a0895e620/plugin/pkg/scheduler/factory/factory.go#L58

This is how it is filled:

https://github.com/kubernetes/kubernetes/blob/1c5af3e72feb00cf6510c8c10abb991a0895e620/plugin/pkg/scheduler/factory/factory.go#L388

That is actually a:

https://github.com/kubernetes/kubernetes/blob/1c5af3e72feb00cf6510c8c10abb991a0895e620/plugin/pkg/scheduler/factory/factory.go#L464

Which uses a ListWatch to actually determine the state changes:

https://github.com/kubernetes/kubernetes/blob/f2ddd60eb9e7e9e29f7a105a9a8fa020042e8e52/pkg/client/cache/listwatch.go#L48

Here's some etcd info on watching:

https://coreos.com/etcd/docs/latest/getting-started-with-etcd.html

This use of etcd is referenced in the kubernetes architecture docs:

https://github.com/eBay/Kubernetes/blob/master/docs/design/architecture.md#etcd

@hammer hammer added the question label Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants