Skip to content

Commit cb4cbbe

Browse files
committed
Seperate priority and preemption
1 parent 7a66f56 commit cb4cbbe

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

docs/concepts/configuration/pod-priority-preemption.md

+28-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ order of Pods and out-of-resource eviction ordering on the Node.
1919

2020
{% capture body %}
2121

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:
2424

2525
1. Enable the feature.
2626

@@ -32,9 +32,9 @@ Of course you do not need to create the Pods directly; normally you would add
3232

3333
The following sections provide more information about these steps.
3434

35-
## Enabling priority and preemption
35+
## Enabling priority
3636

37-
Pod priority and preemption is disabled by default in Kubernetes 1.8.
37+
Pod priority is disabled by default in Kubernetes 1.8.
3838
To enable the feature, set this command-line flag for the API server, scheduler and kubelet:
3939

4040
```
@@ -51,6 +51,30 @@ Also enable scheduling.k8s.io/v1alpha1 API and Priority [admission controller](/
5151
After the feature is enabled, you can create [PriorityClasses](#priorityclass)
5252
and create Pods with [`priorityClassName`](#pod-priority) set.
5353

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+
5478
If you try the feature and then decide to disable it, you must remove the PodPriority
5579
command-line flag or set it to false, and then restart the API server and
5680
scheduler. After the feature is disabled, the existing Pods keep their priority

0 commit comments

Comments
 (0)