From f5524153ba5be7f2988bf5f0f80efe98737f42e8 Mon Sep 17 00:00:00 2001 From: lixiang Date: Tue, 4 Aug 2020 11:11:40 +0800 Subject: [PATCH] README: add description for priority threshold --- README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 69ea8fe6d..4c0e3a585 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,9 @@ strategies: maxPodLifeTimeSeconds: 86400 ```` -## Namespace filtering +## Filter Pods + +### Namespace filtering Strategies like `PodLifeTime`, `RemovePodsHavingTooManyRestarts`, `RemovePodsViolatingNodeTaints`, `RemovePodsViolatingNodeAffinity` and `RemovePodsViolatingInterPodAntiAffinity` can specify `namespaces` @@ -276,6 +278,41 @@ The strategy gets executed over all namespaces but `namespace1` and `namespace2` It's not allowed to compute `include` with `exclude` field. +### Priority filtering + +All strategies are able to configure a priority threshold, only pods under the threshold can be evicted. You can +specify this threshold by setting `thresholdPriorityClassName`(setting the threshold to the value of the given +priority class) or `thresholdPriority`(directly setting the threshold) parameters. By default, this threshold +is set to the value of `system-cluster-critical` priority class. +E.g. + +Setting `thresholdPriority` +``` +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "PodLifeTime": + enabled: true + params: + maxPodLifeTimeSeconds: 86400 + thresholdPriority: 10000 +``` + +Setting `thresholdPriorityClassName` +``` +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "PodLifeTime": + enabled: true + params: + maxPodLifeTimeSeconds: 86400 + thresholdPriorityClassName: "priorityclass1" +``` + +Note that you can't configure both `thresholdPriority` and `thresholdPriorityClassName`, if the given priority class +does not exist, descheduler won't create it and will throw an error. + ## Pod Evictions When the descheduler decides to evict pods from a node, it employs the following general mechanism: