You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: post/2017-09-25-Kubernetes-Scheduler.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
####Kubernetes Scheduler
1
+
# Kubernetes Scheduler
2
2
3
-
#####1. Scheduler Introducation
3
+
## 1. Scheduler Introducation
4
4
5
5
The Kubernetes Scheduler runs as a process alongside the other master components such as the API server. Its interface to the API server is to watch for Pods with an empty ```PodSpec.NodeName```, and for each Pod, it posts a binding indicating where the Pod should be scheduled.
The Kubernetes Scheduler is focused on scheduling pods into specified work nodes by schedule algorithm, which also be called ```Bind```.The input of Scheduler is the pods which need to be scheduled and the nodes which could be scheduled into, and the output of Scheduler is ```Bind``` which connects between pods and nodes.
12
12
@@ -19,7 +19,7 @@ The Kubernetes Scheduler tries to find a node for each Pod, one at a time.
Scheduler main implementations include ```plugin/cmd/kube-scheduler``` and ```plugin/pkg/scheduler```.
25
25
-```plugin/cmd/kube-scheduler``` starts the Scheduler process and reads the configurations from Command Line Interface and so on.
@@ -29,7 +29,7 @@ Scheduler main implementations include ```plugin/cmd/kube-scheduler``` and ```pl
29
29
-```plugin/pkg/scheduler/scheduler.go``` is the main class of Scheduler.
30
30
-```plugin/pkg/scheduler/core/generic_scheduler.go``` invokes the detail scheduling algorithm.
31
31
32
-
-The entrance of Scheduler is ```plugin/cmd/kube-scheduler/scheduler.go```.
32
+
The entrance of Scheduler is ```plugin/cmd/kube-scheduler/scheduler.go```.
33
33
- First Scheduler creates ```configFactory``` and then creates ```config```.
34
34
- If it specifies policy-config-file, Scheduler will create ```config``` by policy-config-file(CreateFromConfig),
35
35
- If not, Scheduler will create ```config``` by Scheduler algorithm providers(CreateFromProvider),
@@ -68,76 +68,76 @@ The Kubernetes Scheduler is able to find the most fit node for pods. The actual
68
68
"hardPodAffinitySymmetricWeight" : 10
69
69
}
70
70
71
-
#####4. Scheduler Algorithm
71
+
## 4. Scheduler Algorithm
72
72
73
-
######4.1 Default Predicates
73
+
### 4.1 Default Predicates
74
74
75
-
####### 4.1.1 NoVolumeZoneConflict
75
+
#### 4.1.1 NoVolumeZoneConflict
76
76
77
77
Evaluate if the volumes a pod requests are available on the node, given the Zone restrictions.
78
78
79
-
####### 4.1.2 MaxEBSVolumeCount
79
+
#### 4.1.2 MaxEBSVolumeCount
80
80
Ensure that the number of attached ElasticBlockStore volumes does not exceed a maximum value (by default, 39, since Amazon recommends a maximum of 40 with one of those 40 reserved for the root volume -- see Amazon's documentation). The maximum value can be controlled by setting the KUBE_MAX_PD_VOLS environment variable.
81
81
82
-
####### 4.1.3 MaxGCEPDVolumeCount
82
+
#### 4.1.3 MaxGCEPDVolumeCount
83
83
Ensure that the number of attached GCE PersistentDisk volumes does not exceed a maximum value (by default, 16, which is the maximum GCE allows -- see GCE's documentation). The maximum value can be controlled by setting the KUBE_MAX_PD_VOLS environment variable.
84
84
85
-
####### 4.1.4 MaxAzureDiskVolumeCount
85
+
#### 4.1.4 MaxAzureDiskVolumeCount
86
86
Ensure that the number of attached Azure volumes does not exceed a maximum value (by default, 16).
87
87
88
-
####### 4.1.5 MatchInterPodAffinity
88
+
#### 4.1.5 MatchInterPodAffinity
89
89
Fit is determined by inter-pod affinity. AffinityAnnotationKey represents the key of affinity data (json serialized) in the Annotations of a Pod.
90
90
91
-
####### 4.1.6 NoDiskConflict
91
+
#### 4.1.6 NoDiskConflict
92
92
Evaluate if a pod can fit due to the volumes it requests, and those that are already mounted. Currently supported volumes are: AWS EBS, GCE PD, ISCSI and Ceph RBD. Only Persistent Volume Claims for those supported types are checked. Persistent Volumes added directly to pods are not evaluated and are not constrained by this policy.
93
93
94
-
####### 4.1.7 GeneralPredicates
95
-
(1) PodFitsResources
94
+
#### 4.1.7 GeneralPredicates
95
+
#####PodFitsResources
96
96
Check if the free resource (CPU and Memory) meets the requirement of the Pod. The free resource is measured by the capacity minus the sum of requests of all Pods on the node. To learn more about the resource QoS in Kubernetes, please check QoS proposal.
97
97
98
-
(2) PodFitsHost
98
+
#####PodFitsHost
99
99
Filter out all nodes except the one specified in the PodSpec's NodeName field.
100
100
101
-
(3) PodFitsHostPorts
101
+
#####PodFitsHostPorts
102
102
Check if any HostPort required by the Pod is already occupied on the node.
103
103
104
-
(4) PodMatchNodeSelector
104
+
#####PodMatchNodeSelector
105
105
PodMatchNodeSelector checks if a pod node selector matches the node label.
106
106
107
-
####### 4.1.8 CheckNodeMemoryPressure
107
+
#### 4.1.8 CheckNodeMemoryPressure
108
108
Check if a pod can be scheduled on a node reporting memory pressure condition. Currently, no BestEffort should be placed on a node under memory pressure as it gets automatically evicted by kubelet.
109
109
110
-
####### 4.1.9 CheckNodeDiskPressure
110
+
#### 4.1.9 CheckNodeDiskPressure
111
111
Check if a pod can be scheduled on a node reporting disk pressure condition. Currently, no pods should be placed on a node under disk pressure as it gets automatically evicted by kubelet.
112
112
113
-
####### 4.1.10 NoVolumeNodeConflict
113
+
#### 4.1.10 NoVolumeNodeConflict
114
114
Fit is determined by volume zone requirements.
115
115
116
-
####### 4.1.11 PodToleratesNodeTaints
116
+
#### 4.1.11 PodToleratesNodeTaints
117
117
Fit is determined based on whether a pod can tolerate all of the node's taints.
Spread Pods by minimizing the number of Pods belonging to the same service, replication controller, or replica set on the same node. If zone information is present on the nodes, the priority will be adjusted so that pods are spread across zones and nodes.
124
124
125
-
####### 4.2.2 InterPodAffinityPriority
125
+
#### 4.2.2 InterPodAffinityPriority
126
126
Pods should be placed in the same topological domain (e.g. same node, same rack, same zone, same power domain, etc.)
127
127
as some other pods, or, conversely, should not be placed in the same topological domain as some other pods.
128
128
129
-
####### 4.2.3 LeastRequestedPriority
129
+
#### 4.2.3 LeastRequestedPriority
130
130
The node is prioritized based on the fraction of the node that would be free if the new Pod were scheduled onto the node. (In other words, (capacity - sum of requests of all Pods already on the node - request of Pod that is being scheduled) / capacity). CPU and memory are equally weighted. The node with the highest free fraction is the most preferred. Note that this priority function has the effect of spreading Pods across the nodes with respect to resource consumption.
131
131
132
-
####### 4.2.4 BalancedResourceAllocation
132
+
#### 4.2.4 BalancedResourceAllocation
133
133
This priority function tries to put the Pod on a node such that the CPU and Memory utilization rate is balanced after the Pod is deployed.
0 commit comments