1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 13:29:11 +01:00
Commit Graph

600 Commits

Author SHA1 Message Date
Jan Chaloupka
29c0a90998 TestPodEvictorReset: replace duplicates strategy with node taints to simplify the testing 2024-08-14 11:00:20 +02:00
Kubernetes Prow Robot
640b675e86 Merge pull request #1484 from ingvagabund/test-descheduling-limits
[unit test]: test descheduling limits
2024-08-14 01:53:04 -07:00
Kubernetes Prow Robot
c0c26e762b Merge pull request #1483 from ingvagabund/dedup-framework-init
tests: de-duplicate framework handle initialization
2024-08-14 01:20:26 -07:00
Jan Chaloupka
91e5e06b5f [unit test]: test descheduling limits 2024-08-14 10:15:58 +02:00
Jan Chaloupka
cbade38d23 [tests] de-duplicate framework handle initialization 2024-08-12 17:05:30 +02:00
Jan Chaloupka
1e0b1a9840 Remove descheduler/v1alpha1 type 2024-08-09 09:49:59 +02:00
Amir Alavi
a3146a1705 fix: minor version parsing in version compatibility check
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-07-28 11:44:12 -04:00
Victor Gonzalez
55a0812ae6 skip eviction when pod creation time is below minPodAge threshold setting (#1475)
* skip eviction when pod creation time is below minPodAge threshold setting

In the default initialization phase of the descheduler, add a new
constraint to not evict pods that creation time is below minPodAge
threshold.

Added value:

- Avoid crazy pod movement when the autoscaler scales up and down.

- Avoid evicting pods when they are warming up.

- Decreases the overall cost of eviction as no pod will be evicted
  before doing significant amount of work.

- Guard against scheduling. Descheduling loops in situations where
  the descheduler has a different node fit logic from scheduler,
  like not considering topology spread constraints.

* Use *time.Duration instead of uint for MinPodAge type

* Remove '(in minutes)' from default evictor configuration table

* make fmt

* Add explicit name for Duration field

* Use Duration.String()
2024-07-26 05:59:21 -07:00
Adam Malcontenti-Wilson
f23967a88e feat: add init and ephemeral container checks to PodLifeTime 2024-07-17 14:36:35 +10:00
Emin Aktas
f8e128d862 refactor: replace k8s.io/utils/pointer with k8s.io/utils/ptr
Signed-off-by: Emin Aktas <eminaktas34@gmail.com>
2024-07-11 11:36:34 +03:00
Kubernetes Prow Robot
b614c8bc7c Merge pull request #1458 from ingvagabund/pod-evictor-thread-safe
pod evictor: make it thread safe
2024-07-10 04:48:26 -07:00
Kubernetes Prow Robot
9b41edd382 Merge pull request #1460 from ingvagabund/context
descheduler_test.go: initDescheduler: pass a new ctx with cancel inst…
2024-07-09 11:24:11 -07:00
Jan Chaloupka
bc60a058ef pod evictor: make it thread safe
Currently, all the plugins are run in a sequence.
No plugin executes evictions in parallel within.
Yet, there's no guarantee a future plugin (e.g. a custom one)
will not attemp to evict pods in parallel.
2024-07-09 12:39:08 +02:00
Kubernetes Prow Robot
546a39e88c Merge pull request #1451 from zhifei92/support-total-pods-limit
The descheduler supports limiting the total number of pods evicted per rescheduling cycle
2024-07-09 03:35:17 -07:00
zhifei92
578086ca8e refactor: optimize error descriptions 2024-07-09 17:14:34 +08:00
Jan Chaloupka
ea2eeccff4 descheduler_test.go: initDescheduler: pass a new ctx with cancel instead of returning a cancel 2024-07-09 09:19:59 +02:00
zhifei92
e60f525ec6 feat: support MaxNoOfPodsToEvictTotal 2024-07-09 14:00:27 +08:00
Jan Chaloupka
3362fec7b0 Define initDescheduler for further use
Can be used by other tests executing individual descheduling cycle
explicitly.
2024-07-08 17:28:51 +02:00
Jan Chaloupka
f240648df2 Set OwnerReferences through GetReplicaSetOwnerRefList 2024-07-08 17:10:07 +02:00
Jan Chaloupka
a818c01832 Use v1alpha2 descheduling policy 2024-07-08 17:04:53 +02:00
Jan Chaloupka
44b59f9b1d initPluginRegistry as a single way to register all plugins in testing 2024-07-08 16:55:27 +02:00
Kubernetes Prow Robot
9d16c28f43 Merge pull request #1456 from ingvagabund/limit-exceeded-to-error
PodEvictor: turn an exceeded limit into an error
2024-07-08 06:25:06 -07:00
googs1025
db0df6c6ca fix: add info for error return 2024-07-07 21:16:52 +08:00
Jan Chaloupka
18d0e4a540 PodEvictor: turn an exceeded limit into an error
When checking for node limit getting exceeded the pod eviction
never fails. Thus, ignoring the metric reporting when a pod fails
to be evicted due to node limit constrains.

The error also allows plugin to react on other limits getting
exceeded. E.g. the limit on the number of pods evicted per namespace.
2024-07-06 20:14:43 +02:00
Kubernetes Prow Robot
7657345079 Merge pull request #1452 from a7i/defaultevictor-reinit
fix: indexer cache error when default evictor is re-initialized
2024-07-06 04:30:53 -07:00
Amir Alavi
e26f6429a2 feat: pod evictor options 2024-07-05 21:40:55 -04:00
Amir Alavi
7ab36daaec fix: indexer cache error when default evictor is re-initialized
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-06-28 00:34:55 -04:00
Kubernetes Prow Robot
f2be3fd414 Merge pull request #1436 from fanhaouu/feat-return-node-fit-error
return node fit error in advance
2024-06-27 10:54:41 -07:00
googs1025
cfa6845a19 refactor: PodMatchNodeSelector method 2024-06-27 22:10:41 +08:00
Hao Fan
8a2b2eb37c return node fit error in advance 2024-06-26 17:18:32 +08:00
Kubernetes Prow Robot
972d28108a Merge pull request #1447 from ingvagabund/refactorings
PodEvictor: refactoring and preparation for eviction requests
2024-06-25 01:08:44 -07:00
Kubernetes Prow Robot
f294d953a3 Merge pull request #1445 from zhifei92/fix-unit-test
Unit-test: add necessary ownerRef to the pod.
2024-06-25 00:15:40 -07:00
Jan Chaloupka
fadef326ff TestPodEvictorReset: check the dry mode evicts duplicated pods 2024-06-23 20:30:36 +02:00
Jan Chaloupka
f5060adcd1 Move fake client from the cachedClient function
Remove the fakeClient from cachedClient function so a different
fakeClient can be injected for testing purposes
2024-06-23 19:59:46 +02:00
Jan Chaloupka
75880226c0 Set up the pod evictor only once
Currently, the pod evictor is created during each descheduling cycle
to reset the internal counters and the fake client (in case a dry run is
configured). Instead, create the pod evictor once and reset only what's
needed. So later on the pod evictor can be extended with e.g. a cache
keeping the track of eviction requests that are still in progress and
required more than a single descheduling cycle to complete.
2024-06-23 19:24:27 +02:00
Jan Chaloupka
0901cb18bf NewPodEvictor: drop nodes parameter 2024-06-22 15:08:00 +02:00
googs1025
6fdee47cbc fix: return the unmatched cases first, then perform the eviction 2024-06-22 18:16:40 +08:00
zhifei92
ae15fed7e7 fix(unit-test): add necessary ownerRef to the pod. 2024-06-21 19:12:40 +08:00
Kubernetes Prow Robot
cdbd101eae Merge pull request #1438 from googs1025/clean_up_nodelister
chore: cleanup duplicated code
2024-06-20 07:07:16 -07:00
googs1025
0e2478ac41 add validation ut 2024-06-13 11:56:33 +08:00
googs1025
ec33490314 chore: cleanup duplicated code 2024-06-12 08:56:13 +08:00
Hao Fan
fd7fcbddfe return pod qos in advance 2024-06-10 00:22:17 +08:00
Mike Dame
d699454d5e Bump otel semconv to 1.24 2024-06-06 13:05:55 +00:00
Hao Fan
c80556fc91 fix the issue that the pod anti-filtering rules are not taking effect 2024-06-02 18:58:57 +08:00
Yuan Chen
25b9edae3c Add an extra parameter ExitCode to RemoveFailedPod
Update README.md

Fix README and test files

Update README

Address a7i's comments

Update README
2024-05-02 17:11:50 -07:00
Gabriel Tiossi
82559025b1 Allow eviction of DaemonSet pods (#1342)
* feat: evictDaemonSetPods flag for evictors

* test: evictDaemonSetPods unit and e2e

* docs: evictDaemonSetPods
2024-04-09 07:47:34 -07:00
Kubernetes Prow Robot
970b35d737 Merge pull request #1369 from fanhaouu/feat-avoid-defaultEvictorArgs-conversion-twice
avoid redundant type conversion of DefaultEvictorArgs parameter in DefaultEvictor
2024-04-03 18:58:17 -07:00
Kubernetes Prow Robot
364f467421 Merge pull request #1365 from ls-2018/master
`RemoveDuplicates`: reduce cycle times identifying duplicates
2024-04-03 18:58:10 -07:00
Hao Fan
7f20b5c891 fix: avoid redundant type conversion of DefaultEvictorArgs parameters in DefaultEvictor
Signed-off-by: Hao Fan <hao.fan@shopee.com>
2024-03-28 15:25:42 +08:00
Kubernetes Prow Robot
e63e159c04 Merge pull request #1360 from etoster/remove-only-pods-violating-included-node-taints
Add argument to remove only pods violating allowlisted taints
2024-03-25 07:39:12 -07:00