Kubernetes 调度器

Kubernetes scheduler

Kubernetes 调度程序是否将 pods 分配给队列中的节点(非并行)?

根据this,我猜可能是这种情况,因为提到了节点是循环迭代的。

我想确保 pod 调度不是并行进行的。

简答

考虑到 kube-scheduler 在调度 pod 时执行的所有进程,答案是

调度器和pods

For every newly created pod or other unscheduled pods, kube-scheduler selects an optimal node for them to run on. However, every container in pods has different requirements for resources and every pod also has different requirements. Therefore, existing nodes need to be filtered according to the specific scheduling requirements.

In a cluster, Nodes that meet the scheduling requirements for a Pod are called feasible nodes. If none of the nodes are suitable, the pod remains unscheduled until the scheduler is able to place it.

The scheduler finds feasible Nodes for a Pod and then runs a set of functions to score the feasible Nodes and picks a Node with the highest score among the feasible ones to run the Pod. The scheduler then notifies the API server about this decision in a process called binding.

Reference - kube-scheduler.

The scheduler determines which Nodes are valid placements for each Pod in the scheduling queue according to constraints and available resources.

Reference - kube-scheduler - synopsis.

简而言之,kube-scheduler 一个接一个地挑选 pods,评估它们及其请求,然后继续寻找合适的 feasible 节点来安排 pods .

调度器和节点

提到的 link 与节点相关,以便在所有 feasible 个节点中为 运行 pods 提供公平的机会。

Nodes in a cluster that meet the scheduling requirements of a Pod are called feasible Nodes for the Pod

此处的信息与默认kube-scheduler有关,有解决方案可以使用,甚至可以实现自写的。也可以 运行 multiple schedulers in cluster.

有用links: