Skip to content

Commit

Permalink
Seperate priority and preemption
Browse files Browse the repository at this point in the history
  • Loading branch information
resouer committed Apr 20, 2018
1 parent 7a66f56 commit cb4cbbe
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions docs/concepts/configuration/pod-priority-preemption.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ order of Pods and out-of-resource eviction ordering on the Node.

{% capture body %}

## How to use priority and preemption
To use priority and preemption in Kubernetes 1.8 and later, follow these steps:
## How to use priority
To use priority in Kubernetes 1.8 and later, follow these steps:

1. Enable the feature.

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

The following sections provide more information about these steps.

## Enabling priority and preemption
## Enabling priority

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

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


## How to use preemption

Before Kubernetes 1.11, preemption is bound with `PodPriority` feature gate and will be automatically enabled with priority.

But in Kubernetes 1.11 and later, preemption is controlled by a kube-scheduler flag `disablePreemption` which is `false` by default.
Please note, although preemption is enabled by default, it will be ignored if priority feature is disabled.

If you want to use priority without enabling preemption, you can set `disablePreemption` to `true` and enable `PodPriority` feature
at the same time, here's a sample configuration:

```yaml
apiVersion: componentconfig/v1alpha1
kind: KubeSchedulerConfiguration
algorithmSource:
provider: DefaultProvider

...

disablePreemption: true

```
If you try the feature and then decide to disable it, you must remove the PodPriority
command-line flag or set it to false, and then restart the API server and
scheduler. After the feature is disabled, the existing Pods keep their priority
Expand Down

0 comments on commit cb4cbbe

Please sign in to comment.