k8s schedule frame
时间: 2023-10-27 10:32:00 浏览: 75
Kubernetes (k8s) uses a scheduling framework to assign pods to nodes in a cluster. The scheduling framework consists of three main components:
1. Predicates: Predicates are a set of rules that determine whether a node is suitable for a pod. For example, a predicate might check if a node has enough CPU or memory resources to accommodate a pod. If a node fails any of the predicates, it will not be considered as a candidate for scheduling the pod.
2. Priorities: Priorities are used to rank the candidate nodes that pass the predicates. Each priority function assigns a score to a node based on various factors such as the available resources, node labels, and affinity rules. Nodes with higher scores are considered better candidates for scheduling.
3. Bindings: Once a node is selected, the scheduler creates a binding between the pod and the node. The binding is recorded in the Kubernetes API server and the kubelet on the selected node is responsible for launching the pod.
Overall, the scheduling framework provides a flexible and extensible way to ensure that pods are scheduled on the most suitable nodes in a Kubernetes cluster.
阅读全文