Questão de Kubernetes Scheduling #019e3a4f
What factors influence the Kubernetes scheduler when it places Pods on nodes?
Pod memory requests, node taints, and Pod affinity.
Pod labels, node labels, and request labels.
Node taints, node level, and Pod priority.
Pod priority, container command, and node labels.
Explicação Oficial / Explicações da Comunidade
The Kubernetes scheduler determines the optimal node for each Pod based on a set of predicates and priorities. The correct factors include Pod memory requests, node taints, and Pod affinity.
How it Works
The scheduler first filters nodes that satisfy the Pod's resource requests (e.g., memory and CPU). It then applies predicates like node taints and tolerations: a Pod can only be placed on a node if it tolerates all of the node's taints. Finally, priority functions such as Pod affinity/anti-affinity and node affinity influence scoring to choose the best node.
Why the Correct Value is Right
- Pod memory requests: The scheduler ensures the node has enough allocatable memory to meet the Pod's request.
- Node taints: Taints repel Pods unless the Pod has matching tolerations, directly affecting placement.
- Pod affinity: Rules that attract or repel Pods relative to other Pods, influencing scheduling decisions.
Why the Incorrect Values are Wrong
- Pod labels, node labels, and request labels: While node labels are used in node affinity, "request labels" is not a standard concept. Pod labels are not directly used by the scheduler; instead, label selectors in affinity rules are used.
- Node taints, node level, and Pod priority: "Node level" is not a scheduling factor. Pod priority is used for preemption but not as a direct placement factor in the basic scheduling algorithm.
- Pod priority, container command, and node labels: The container command does not influence scheduling. Pod priority affects preemption but not the initial placement decision in the default scheduler.