Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#410 from lixiang233/Add_lowNodeUti…
Browse files Browse the repository at this point in the history
…lization_usecase

Add use case for lowNodeUtilization
  • Loading branch information
(Brien Dieterle) committed Sep 29, 2020
2 parents 2e18e4e + 0a12c6d commit 9774680
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
35 changes: 23 additions & 12 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,35 @@ 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:
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
Expand Down
12 changes: 12 additions & 0 deletions examples/low-node-utilization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: "descheduler/v1alpha1"
kind: "DeschedulerPolicy"
strategies:
"LowNodeUtilization":
enabled: true
params:
nodeResourceUtilizationThresholds:
thresholds:
"memory": 20
targetThresholds:
"memory": 70
12 changes: 0 additions & 12 deletions examples/pod-life-time.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9774680

Please sign in to comment.