@@ -19,8 +19,8 @@ order of Pods and out-of-resource eviction ordering on the Node.
19
19
20
20
{% capture body %}
21
21
22
- ## How to use priority and preemption
23
- To use priority and preemption in Kubernetes 1.8 and later, follow these steps:
22
+ ## How to use priority
23
+ To use priority in Kubernetes 1.8 and later, follow these steps:
24
24
25
25
1 . Enable the feature.
26
26
@@ -32,9 +32,9 @@ Of course you do not need to create the Pods directly; normally you would add
32
32
33
33
The following sections provide more information about these steps.
34
34
35
- ## Enabling priority and preemption
35
+ ## Enabling priority
36
36
37
- Pod priority and preemption is disabled by default in Kubernetes 1.8.
37
+ Pod priority is disabled by default in Kubernetes 1.8.
38
38
To enable the feature, set this command-line flag for the API server, scheduler and kubelet:
39
39
40
40
```
@@ -51,6 +51,30 @@ Also enable scheduling.k8s.io/v1alpha1 API and Priority [admission controller](/
51
51
After the feature is enabled, you can create [ PriorityClasses] ( #priorityclass )
52
52
and create Pods with [ ` priorityClassName ` ] ( #pod-priority ) set.
53
53
54
+
55
+ ## How to use preemption
56
+
57
+ Before Kubernetes 1.11, preemption is bound with ` PodPriority ` feature gate and will be automatically enabled with priority.
58
+
59
+ But in Kubernetes 1.11 and later, preemption is controlled by a kube-scheduler flag ` disablePreemption ` which is ` false ` by default.
60
+ Please note, although preemption is enabled by default, it will be ignored if priority feature is disabled.
61
+
62
+ If you want to use priority without enabling preemption, you can set ` disablePreemption ` to ` true ` and enable ` PodPriority ` feature
63
+ at the same time, here's a sample configuration:
64
+
65
+ ``` yaml
66
+ apiVersion : componentconfig/v1alpha1
67
+ kind : KubeSchedulerConfiguration
68
+ algorithmSource :
69
+ provider : DefaultProvider
70
+
71
+ ...
72
+
73
+ disablePreemption : true
74
+
75
+ ` ` `
76
+
77
+
54
78
If you try the feature and then decide to disable it, you must remove the PodPriority
55
79
command-line flag or set it to false, and then restart the API server and
56
80
scheduler. After the feature is disabled, the existing Pods keep their priority
0 commit comments