From 42db31683fb43f73f87c7d2a6a3bf06329a7b0dc Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Wed, 22 Jul 2020 15:49:27 +0200 Subject: [PATCH] README: describe usage of the namespace filtering --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index edbbaa04b..6519e6466 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,48 @@ strategies: maxPodLifeTimeSeconds: 86400 ```` +## Namespace filtering + +Strategies like `PodLifeTime`, `RemovePodsHavingTooManyRestarts`, `RemovePodsViolatingNodeTaints`, +`RemovePodsViolatingNodeAffinity` and `RemovePodsViolatingInterPodAntiAffinity` can specify `namespaces` +parameter which allows to specify a list of including, resp. excluding namespaces. +E.g. + +``` +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "PodLifeTime": + enabled: true + params: + maxPodLifeTimeSeconds: 86400 + namespaces: + include: + - "namespace1" + - "namespace2" +``` + +In the examples `PodLifeTime` gets executed only over `namespace1` and `namespace2`. +The similar holds for `exclude` field: + +``` +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "PodLifeTime": + enabled: true + params: + maxPodLifeTimeSeconds: 86400 + namespaces: + exclude: + - "namespace1" + - "namespace2" +``` + +The strategy gets executed over all namespaces but `namespace1` and `namespace2`. + +It's not allowed to compute `include` with `exclude` field. + ## Pod Evictions When the descheduler decides to evict pods from a node, it employs the following general mechanism: