|
9 | 9 | The existing generic scheduler is the default platform-provided scheduler |
10 | 10 | _engine_ that selects a node to host the pod in a three-step operation: |
11 | 11 |
|
12 | | - |
13 | | -Filters the Nodes:: |
| 12 | +Filters the nodes:: |
14 | 13 | The available nodes are filtered based on the constraints or requirements |
15 | 14 | specified. This is done by running each node through the list of filter |
16 | | -functions called _predicates_. |
| 15 | +functions called _predicates_, or _filters_. |
17 | 16 |
|
18 | | -Prioritize the Filtered List of Nodes:: |
19 | | -This is achieved by passing each node through a series of priority_ functions |
| 17 | +Prioritizes the filtered list of nodes:: |
| 18 | +This is achieved by passing each node through a series of _priority_, or _scoring_, functions |
20 | 19 | that assign it a score between 0 - 10, with 0 indicating a bad fit and 10 |
21 | 20 | indicating a good fit to host the pod. The scheduler configuration can also take |
22 | | -in a simple _weight_ (positive numeric value) for each priority function. The |
23 | | -node score provided by each priority function is multiplied by the weight |
24 | | -(default weight for most priorities is 1) and then combined by adding the scores for each node |
25 | | -provided by all the priorities. This weight attribute can be used by |
26 | | -administrators to give higher importance to some priorities. |
| 21 | +in a simple _weight_ (positive numeric value) for each scoring function. The |
| 22 | +node score provided by each scoring function is multiplied by the weight |
| 23 | +(default weight for most scores is 1) and then combined by adding the scores for each node |
| 24 | +provided by all the scores. This weight attribute can be used by |
| 25 | +administrators to give higher importance to some scores. |
27 | 26 |
|
28 | | -Select the Best Fit Node:: |
| 27 | +Selects the best fit node:: |
29 | 28 | The nodes are sorted based on their scores and the node with the highest score |
30 | 29 | is selected to host the pod. If multiple nodes have the same high score, then |
31 | 30 | one of them is selected at random. |
32 | | - |
33 | | -[id="nodes-scheduler-default-about-understanding_{context}"] |
34 | | -== Understanding Scheduler Policy |
35 | | - |
36 | | -The selection of the predicate and priorities defines the policy for the scheduler. |
37 | | - |
38 | | -The scheduler configuration file is a JSON file, which must be named `policy.cfg`, that specifies the predicates and priorities the scheduler |
39 | | -will consider. |
40 | | - |
41 | | -In the absence of the scheduler policy file, the default scheduler behavior is used. |
42 | | - |
43 | | -// we are working on how to configures this in 4.0 right now in https://github.com/openshift/api/pull/181 |
44 | | - |
45 | | -[IMPORTANT] |
46 | | -==== |
47 | | -The predicates and priorities defined in |
48 | | -the scheduler configuration file completely override the default scheduler |
49 | | -policy. If any of the default predicates and priorities are required, |
50 | | -you must explicitly specify the functions in the policy configuration. |
51 | | -==== |
52 | | - |
53 | | -.Sample scheduler config map |
54 | | -[source,yaml] |
55 | | ----- |
56 | | -apiVersion: v1 |
57 | | -data: |
58 | | - policy.cfg: | |
59 | | - { |
60 | | - "kind" : "Policy", |
61 | | - "apiVersion" : "v1", |
62 | | - "predicates" : [ |
63 | | - {"name" : "MaxGCEPDVolumeCount"}, |
64 | | - {"name" : "GeneralPredicates"}, <1> |
65 | | - {"name" : "MaxAzureDiskVolumeCount"}, |
66 | | - {"name" : "MaxCSIVolumeCountPred"}, |
67 | | - {"name" : "CheckVolumeBinding"}, |
68 | | - {"name" : "MaxEBSVolumeCount"}, |
69 | | - {"name" : "MatchInterPodAffinity"}, |
70 | | - {"name" : "CheckNodeUnschedulable"}, |
71 | | - {"name" : "NoDiskConflict"}, |
72 | | - {"name" : "NoVolumeZoneConflict"}, |
73 | | - {"name" : "PodToleratesNodeTaints"} |
74 | | - ], |
75 | | - "priorities" : [ |
76 | | - {"name" : "LeastRequestedPriority", "weight" : 1}, |
77 | | - {"name" : "BalancedResourceAllocation", "weight" : 1}, |
78 | | - {"name" : "ServiceSpreadingPriority", "weight" : 1}, |
79 | | - {"name" : "NodePreferAvoidPodsPriority", "weight" : 1}, |
80 | | - {"name" : "NodeAffinityPriority", "weight" : 1}, |
81 | | - {"name" : "TaintTolerationPriority", "weight" : 1}, |
82 | | - {"name" : "ImageLocalityPriority", "weight" : 1}, |
83 | | - {"name" : "SelectorSpreadPriority", "weight" : 1}, |
84 | | - {"name" : "InterPodAffinityPriority", "weight" : 1}, |
85 | | - {"name" : "EqualPriority", "weight" : 1} |
86 | | - ] |
87 | | - } |
88 | | -kind: ConfigMap |
89 | | -metadata: |
90 | | - creationTimestamp: "2019-09-17T08:42:33Z" |
91 | | - name: scheduler-policy |
92 | | - namespace: openshift-config |
93 | | - resourceVersion: "59500" |
94 | | - selfLink: /api/v1/namespaces/openshift-config/configmaps/scheduler-policy |
95 | | - uid: 17ee8865-d927-11e9-b213-02d1e1709840` |
96 | | ----- |
97 | | -<1> The `GeneralPredicates` predicate represents the `PodFitsResources`, `HostName`, `PodFitsHostPorts`, and `MatchNodeSelector` predicates. |
98 | | -Because you are not allowed to configure the same predicate multiple times, the `GeneralPredicates` predicate cannot be used alongside |
99 | | -any of the four represented predicates. |
100 | | - |
101 | | -//// |
102 | | -.Typical predicate string |
103 | | ----- |
104 | | -\n\t{\"name\" : \"<PredicateName>\", \"label\" : \"<label>\", \"<condition>\" : \"<state>\"}, |
105 | | ----- |
106 | | -* `name` is the name of the predicate, such as `labelsPresence`. |
107 | | -* `label` and `<label>` is the node label:value pair to match to apply the predicate, such `label:rack`. |
108 | | -* `<condition>` and `<state>` is when the predicate should be applied, such as `presence:true`. |
109 | | -
|
110 | | -.Typical priority string |
111 | | ----- |
112 | | -\n\t{\"name\" : \"<PredicateName>\", \"label\" : \"<label>\", \"<condition>\" : \"<state>\", \"weight\" : <weight>}, |
113 | | ----- |
114 | | -* `name` is the name of the priority, such as `labelsPresence`. |
115 | | -* `label` and `<label>` is the node `label:value` pair to match to apply the priority, such `label:rack`. |
116 | | -* `<condition>` and `<state>` is when the priority should be applied, such as `presence:true`. |
117 | | -* `weight` and `<weight> is the numerical weight to apply to the priority. |
118 | | -//// |
0 commit comments