Skip to content

Commit

Permalink
Added explanation of non-preempting PriorityClasses to the "Pod Prior…
Browse files Browse the repository at this point in the history
…ity and Preemption" doc.
  • Loading branch information
vllry committed May 29, 2019
1 parent c7c55c5 commit a771921
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions content/en/docs/concepts/configuration/pod-priority-preemption.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ when a cluster is under resource pressure. For this reason, it is not
recommended to disable preemption.
{{< /note >}}

{{< note >}}
In Kubernetes 1.15 and later,
PriorityClasses have the option to set `preemptionPolicy: Never`.
This will prevent pods of that PriorityClass from preempting other pods.
{{< /note >}}

In Kubernetes 1.11 and later, preemption is controlled by a kube-scheduler flag
`disablePreemption`, which is set to `false` by default.
If you want to disable preemption despite the above note, you can set
Expand Down Expand Up @@ -145,6 +151,37 @@ globalDefault: false
description: "This priority class should be used for XYZ service pods only."
```

### Non-preempting PriorityClasses (alpha)

In 1.15,
PriorityClasses gain a non-preempting option,
via the new `PreemptionPolicy` field.
`PreemptionPolicy` defaults to `PreemptLowerPriority`.
If `PreemptionPolicy` is set to `Never`,
preemption will be disabled for pods of that PriorityClass.

A PriorityClass with preempting disabled will still be scheduled based on its
relative priority,
but will not preempt other pods.
Non-preempting PriorityClasses may still be preempted themselves.

An example use case is for data science workloads.
A user may submit a job that they want to be prioritized above other workloads,
but do not wish to discard existing work by preempting running pods.

#### Example Non-preempting PriorityClass

```yaml
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority-nonpreempting
value: 1000000
preemptionPolicy: Never
globalDefault: false
description: "This priority class will not cause other pods to be preempted."
```

## Pod priority

After you have one or more PriorityClasses, you can create Pods that specify one
Expand Down

0 comments on commit a771921

Please sign in to comment.