Kubernetes Cluster Architecture
medium

Questão de Kubernetes Cluster Architecture #019e3a4f

Enunciado da Questão
Kubernetes Cluster Architecture
#kube-scheduler
#pod scheduling
#kubernetes
Médio

Which of these events will cause the kube-scheduler to assign a Pod to a node?

A

When the Pod crashes because of an error.

B

When a new node is added to the Kubernetes cluster.

C

When the CPU load on the node becomes too high.

D

When a new Pod is created and has no assigned node.

Correta

Explicação Oficial / Explicações da Comunidade

The kube-scheduler is responsible for assigning newly created Pods to nodes that have not yet been assigned a node. It does not react to Pod crashes, node additions, or CPU load changes directly; those events may trigger other components but not the scheduler's assignment logic.

How it Works
The kube-scheduler watches the API server for Pods with an empty nodeName field. When a new Pod is created without a node assignment, the scheduler selects a suitable node based on resource requirements, constraints, and policies. It then updates the Pod's nodeName to bind the Pod to that node.

Why the correct value is right
"When a new Pod is created and has no assigned node" is the exact trigger for the scheduler. The scheduler's primary function is to assign unassigned Pods to nodes.

Why the incorrect values are wrong

  • "When the Pod crashes because of an error": A crash does not trigger scheduling; the scheduler only assigns Pods that are newly created and unassigned. A crashed Pod may be restarted by the kubelet on the same node or recreated by a controller, but the scheduler is not involved in crash recovery.
  • "When a new node is added to the Kubernetes cluster": Adding a node does not directly cause the scheduler to assign Pods. The scheduler may consider the new node for future scheduling decisions, but it does not reassign existing Pods.
  • "When the CPU load on the node becomes too high": High CPU load does not trigger scheduling. The scheduler does not monitor node load; it only considers resource requests and limits during initial placement. Load balancing is handled by other mechanisms like horizontal pod autoscaling or descheduler.