Skip to Content
Managing Kubernetes
book

Managing Kubernetes

by Brendan Burns, Craig Tracey
November 2018
Intermediate to advanced content levelIntermediate to advanced
185 pages
4h 39m
English
O'Reilly Media, Inc.
Content preview from Managing Kubernetes

Chapter 5. Scheduler

One of the primary jobs of the Kubernetes API is to schedule containers to worker nodes in the cluster of machines. This task is accomplished by a dedicated binary in the Kubernetes cluster called the Kubernetes scheduler. This chapter describes how the scheduler operates, how it can be extended, and how it can even be replaced or augmented by additional schedulers. Kubernetes can handle a wide variety of workloads, from stateless web serving to stateful applications, big data batch jobs, or machine learning on GPUs. The key to ensuring that all of these very different applications can operate in harmony on the same cluster lies in the application of job scheduling, which ensures that each container is placed onto the worker node best suited to it.

An Overview of Scheduling

When a Pod is first created, it generally doesn’t have a nodeName field. The nodeName indicates the node on which the Pod should execute. The Kubernetes scheduler is constantly scanning the API server (via a watch request) for Pods that don’t have a nodeName; these are Pods that are eligible for scheduling. The scheduler then selects an appropriate node for the Pod and updates the Pod definition with the nodeName that the scheduler selected. After the nodeName is set, the kubelet running on that node is notified about the Pod’s existence (again, via a watch request) and it begins to actually execute that Pod on that node.

Note

If you want to skip the scheduler, you can always set the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Managing Cloud Native Data on Kubernetes

Managing Cloud Native Data on Kubernetes

Jeff Carpenter, Patrick McFadin
Kubernetes Microservices

Kubernetes Microservices

Richard Chesterwood
Kubernetes: Up and Running

Kubernetes: Up and Running

Kelsey Hightower, Brendan Burns, Joe Beda

Publisher Resources

ISBN: 9781492033905Errata Page