Skip to content

Commit f234922

Browse files
committed
feat: support TargetLoadPacking strategy
1 parent e8c099c commit f234922

File tree

155 files changed

+27816
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+27816
-0
lines changed

README.md

+38
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Balance Plugins: These plugins process all pods, or groups of pods, and determin
175175
| [RemoveDuplicates](#removeduplicates) |Balance|Spreads replicas|
176176
| [LowNodeUtilization](#lownodeutilization) |Balance|Spreads pods according to pods resource requests and node resources available|
177177
| [HighNodeUtilization](#highnodeutilization) |Balance|Spreads pods according to pods resource requests and node resources available|
178+
| [TargetLoadPacking](#targetloadpacking) |Balance|Spreads pods according to node utilization metrics|
178179
| [RemovePodsViolatingInterPodAntiAffinity](#removepodsviolatinginterpodantiaffinity) |Deschedule|Evicts pods violating pod anti affinity|
179180
| [RemovePodsViolatingNodeAffinity](#removepodsviolatingnodeaffinity) |Deschedule|Evicts pods violating node affinity|
180181
| [RemovePodsViolatingNodeTaints](#removepodsviolatingnodetaints) |Deschedule|Evicts pods violating node taints|
@@ -390,6 +391,43 @@ This parameter can be configured to activate the strategy only when the number o
390391
is above the configured value. This could be helpful in large clusters where a few nodes could go
391392
under utilized frequently or for a short period of time. By default, `numberOfNodes` is set to zero.
392393

394+
### TargetLoadPacking
395+
396+
This strategy finds nodes that are under utilized and evicts pods, if possible, from other nodes in the hope that recreation of evicted pods will be scheduled on these underutilized nodes. It has the same goal as `LowNodeUtilization`, the only difference is that it makes decisions based on real-time metrics data, not pod resource requests.
397+
398+
This strategy **must** be used with the scheduler scoring strategy [`TargetLoadPacking`](https://github.com/kubernetes-sigs/scheduler-plugins/tree/master/pkg/trimaran/targetloadpacking).
399+
400+
**Parameters:**
401+
402+
Any explanation of the plugin's parameters can be found at [kubernetes-sigs/scheduler-plugins/pkg/trimaran/targetloadpacking](https://github.com/kubernetes-sigs/scheduler-plugins/tree/master/pkg/trimaran/targetloadpacking).
403+
404+
**Example:**
405+
406+
```yaml
407+
apiVersion: "descheduler/v1alpha2"
408+
kind: "DeschedulerPolicy"
409+
profiles:
410+
- name: ProfileName
411+
pluginConfig:
412+
- name: "DefaultEvictor"
413+
- name: "TargetLoadPacking"
414+
args:
415+
defaultRequests:
416+
cpu: "2000m"
417+
defaultRequestsMultiplier: "2"
418+
targetUtilization: 70
419+
metricProvider:
420+
type: Prometheus
421+
address: http://prometheus-k8s.monitoring.svc.cluster.local:9090
422+
plugins:
423+
evict:
424+
enabled:
425+
- "DefaultEvictor"
426+
balance:
427+
enabled:
428+
- "TargetLoadPacking"
429+
```
430+
393431
### RemovePodsViolatingInterPodAntiAffinity
394432

395433
This strategy makes sure that pods violating interpod anti-affinity are removed from nodes. For example,

go.mod

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.20
55
require (
66
github.com/client9/misspell v0.3.4
77
github.com/google/go-cmp v0.5.9
8+
github.com/paypal/load-watcher v0.2.2
89
github.com/spf13/cobra v1.6.0
910
github.com/spf13/pflag v1.0.5
1011
k8s.io/api v0.27.0
@@ -35,6 +36,7 @@ require (
3536
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
3637
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
3738
github.com/felixge/httpsnoop v1.0.3 // indirect
39+
github.com/francoispqt/gojay v1.2.13 // indirect
3840
github.com/fsnotify/fsnotify v1.6.0 // indirect
3941
github.com/go-logr/logr v1.2.3 // indirect
4042
github.com/go-logr/stdr v1.2.2 // indirect
@@ -55,6 +57,7 @@ require (
5557
github.com/imdario/mergo v0.3.6 // indirect
5658
github.com/inconshreveable/mousetrap v1.0.1 // indirect
5759
github.com/josharian/intern v1.0.0 // indirect
60+
github.com/jpillora/backoff v1.0.0 // indirect
5861
github.com/json-iterator/go v1.1.12 // indirect
5962
github.com/mailru/easyjson v0.7.7 // indirect
6063
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
@@ -63,12 +66,14 @@ require (
6366
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6467
github.com/modern-go/reflect2 v1.0.2 // indirect
6568
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
69+
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
6670
github.com/pkg/errors v0.9.1 // indirect
6771
github.com/prometheus/client_golang v1.14.0 // indirect
6872
github.com/prometheus/client_model v0.3.0 // indirect
6973
github.com/prometheus/common v0.37.0 // indirect
7074
github.com/prometheus/procfs v0.8.0 // indirect
7175
github.com/russross/blackfriday/v2 v2.1.0 // indirect
76+
github.com/sirupsen/logrus v1.9.0 // indirect
7277
github.com/stoewer/go-strcase v1.2.0 // indirect
7378
go.etcd.io/etcd/api/v3 v3.5.7 // indirect
7479
go.etcd.io/etcd/client/pkg/v3 v3.5.7 // indirect
@@ -107,6 +112,7 @@ require (
107112
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
108113
k8s.io/kms v0.27.0 // indirect
109114
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
115+
k8s.io/metrics v0.19.0 // indirect
110116
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.1 // indirect
111117
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
112118
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect

0 commit comments

Comments
 (0)