liveBook · Manning

Scheduling

As explained in Kubernetes in Action, Second Edition

Scheduling is the process of selecting suitable compute nodes on which workloads should run.

Scheduling assigns a pod to a worker node. Kubernetes then runs that pod on the assigned node; it does not move the same pod instance if it fails. section 3.3.1

A deployment leads to a running container through this sequence:

  • kubectl sends the deployment request to the Kubernetes API server. section 3.3.1
  • Kubernetes creates a pod and schedules it onto one worker node. section 3.3.1
  • The node's Kubelet notices the assignment, directs Docker to pull the image, creates the container, and starts it. section 3.3.1
  • If the pod fails, Kubernetes may create a replacement pod, which can be scheduled separately. section 3.3.1

Observe scheduling

Create a deployment with `kubectl create deployment kiada --image=luksa/kiada:0.1`, then inspect its pod with `kubectl get pods`. A pod initially shown as `Pending` becomes running after the scheduler assigns it to a worker node; pod events report the assignment and subsequent image and container operations. section 3.3.1

$ kubectl create deployment kiada --image=luksa/kiada:0.1
deployment.apps/kiada created

Use the deployment command to trigger the scheduling lifecycle and compare its output with pod status and events. section 3.3.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains pod assignment, Kubelet reaction, image startup, and replacement behavior without detailing node-selection rules.
Examples
Uses a kubectl deployment, Pending pod output, scheduling events, image pulling, container creation, and startup.
What it assumes
Assumes no prior container, Docker, or Linux experience and builds Kubernetes application concepts progressively.
What you can do after
Operate scheduling indirectly by creating a deployment and inspecting pod status and scheduling events with kubectl.
How it connects
Connects scheduling with pods, worker nodes, deployments, the API server, Kubelet, Docker, and controllers.

Also explained in

Compare how 5 books explain scheduling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.