Jan Chaloupka
e655a7eb27
nodeutilization: NodeUtilization: make pod utilization extraction configurable
2024-11-13 14:21:32 +01:00
Jan Chaloupka
7eeb07d96a
Update nodes sorting function to respect available resources
2024-11-11 16:26:56 +01:00
Simon Scharf
ef0c2c1c47
add ignorePodsWithoutPDB option ( #1529 )
...
* add ignoreNonPDBPods option
* take2
* add test
* poddisruptionbudgets are now used by defaultevictor plugin
* add poddisruptionbudgets to rbac
* review comments
* don't use GetPodPodDisruptionBudgets
* review comment, don't hide error
2024-10-15 21:21:04 +01:00
Jan Chaloupka
89bd188a35
hnu: move static code from Balance under plugin constructor
2024-10-11 16:49:23 +02:00
Jan Chaloupka
e3c41d6ea6
lnu: move static code from Balance under plugin constructor
2024-10-11 16:37:53 +02:00
Jan Chaloupka
e0ff750fa7
Move default LNU threshold setting under setDefaultForLNUThresholds
2024-10-11 16:31:37 +02:00
Simon Scharf
22d9230a67
Make sure dry runs sees all the resources a normal run would do ( #1526 )
...
* generic resource handling, so that dry run has all the expected resource types and objects
* simpler code and better names
* fix imports
2024-10-04 12:20:28 +01:00
Kubernetes Prow Robot
0f1890e5cd
Merge pull request #1480 from ingvagabund/omitempty-for-plugin-args
...
Plugin args: tag arguments with omitempty to reduce the marshalled json size
2024-09-02 12:00:56 +01:00
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
Jan Chaloupka
cb0c1b660d
Plugin args: tag arguments with omitempty to reduce the marshalled json size
2024-08-06 15:20:18 +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