From 6042d717e9b3235ad8006ea5c83aa4f122726720 Mon Sep 17 00:00:00 2001 From: lixiang Date: Thu, 24 Sep 2020 17:49:02 +0800 Subject: [PATCH 1/2] delete disabled strategies in podLifeTime use case --- docs/user-guide.md | 12 ------------ examples/pod-life-time.yml | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index bce12b5a3..9b6de91eb 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -69,18 +69,6 @@ This policy configuration file ensures that pods created more than 7 days ago ar apiVersion: "descheduler/v1alpha1" kind: "DeschedulerPolicy" strategies: - "LowNodeUtilization": - enabled: false - "RemoveDuplicates": - enabled: false - "RemovePodsViolatingInterPodAntiAffinity": - enabled: false - "RemovePodsViolatingNodeAffinity": - enabled: false - "RemovePodsViolatingNodeTaints": - enabled: false - "RemovePodsHavingTooManyRestarts": - enabled: false "PodLifeTime": enabled: true params: diff --git a/examples/pod-life-time.yml b/examples/pod-life-time.yml index 1bce94289..f078c3d1b 100644 --- a/examples/pod-life-time.yml +++ b/examples/pod-life-time.yml @@ -2,18 +2,6 @@ apiVersion: "descheduler/v1alpha1" kind: "DeschedulerPolicy" strategies: - "LowNodeUtilization": - enabled: false - "RemoveDuplicates": - enabled: false - "RemovePodsViolatingInterPodAntiAffinity": - enabled: false - "RemovePodsViolatingNodeAffinity": - enabled: false - "RemovePodsViolatingNodeTaints": - enabled: false - "RemovePodsHavingTooManyRestarts": - enabled: false "PodLifeTime": enabled: true params: From 00f79aa28d070ce75e3be8eba3cf2b9c5fe0db01 Mon Sep 17 00:00:00 2001 From: lixiang Date: Thu, 24 Sep 2020 17:51:08 +0800 Subject: [PATCH 2/2] add use case for lowNodeUtilization --- docs/user-guide.md | 23 +++++++++++++++++++++++ examples/low-node-utilization.yml | 12 ++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 examples/low-node-utilization.yml diff --git a/docs/user-guide.md b/docs/user-guide.md index 9b6de91eb..342d75cfe 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -75,6 +75,29 @@ strategies: maxPodLifeTimeSeconds: 604800 # pods run for a maximum of 7 days ``` +### Balance Cluster By Node Memory Utilization + +If your cluster has been running for a long period of time, you may find that the resource utilization is not very +balanced. The `LowNodeUtilization` strategy can be used to rebalance your cluster based on `cpu`, `memory` +or `number of pods`. + +Using the following policy configuration file, descheduler will rebalance the cluster based on memory by evicting pods +from nodes with memory utilization over 70% to nodes with memory utilization below 20%. + +``` +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "LowNodeUtilization": + enabled: true + params: + nodeResourceUtilizationThresholds: + thresholds: + "memory": 20 + targetThresholds: + "memory": 70 +``` + ### Autoheal Node Problems Descheduler's `RemovePodsViolatingNodeTaints` strategy can be combined with [Node Problem Detector](https://github.com/kubernetes/node-problem-detector/) and diff --git a/examples/low-node-utilization.yml b/examples/low-node-utilization.yml new file mode 100644 index 000000000..bd8d0613f --- /dev/null +++ b/examples/low-node-utilization.yml @@ -0,0 +1,12 @@ +--- +apiVersion: "descheduler/v1alpha1" +kind: "DeschedulerPolicy" +strategies: + "LowNodeUtilization": + enabled: true + params: + nodeResourceUtilizationThresholds: + thresholds: + "memory": 20 + targetThresholds: + "memory": 70