Commit Graph
29 Commits
Author SHA1 Message Date
Kubernetes Prow RobotandGitHub a60ab7b5ed Merge pull request #1786 from W1seKappa/add-namespace-label-selector
Add namespace label selector
2026-02-02 18:24:29 +05:30
Danila Bobkov 4361eefaf2 add namespaceLabelSelector
Signed-off-by: Danila Bobkov <danila.bobkov@flant.com>
2026-02-02 15:22:11 +03:00
Jan Chaloupka 770ec5affa refactor(pkg/descheduler): create fake shared informer factory only once 2026-01-23 21:34:09 +01:00
Jan Chaloupka 988e0b8868 refactor: replace pod.Spec.Volumes with test.SetHostPathEmptyDirVolumeSource in plugin tests 2025-12-21 21:36:24 +01:00
Jan Chaloupka ca0f7535fb refactor: add SetMirrorPodAnnotation helper function 2025-12-15 17:41:46 +01:00
Jan Chaloupka 59dfd041a8 feat(TestPodLifeTime): check only expected pods are evicted 2025-12-11 17:08:25 +01:00
Ricardo Maraschini d9d6ca64e9 feat: enable pod protection based on storage classes
this commit introduces a new customization on the existing PodsWithPVC
protection. this new customization allow users to make pods that refer
to a given storage class unevictable.

for example, to protect pods referring to `storage-class-0` and
`storage-class-1` this configuration can be used:

```yaml
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
- name: ProfileName
  pluginConfig:
  - name: "DefaultEvictor"
    args:
      podProtections:
        extraEnabled:
        - PodsWithPVC
        config:
          PodsWithPVC:
            protectedStorageClasses:
            - name: storage-class-0
            - name: storage-class-1
```

changes introduced by this pr:

1. the descheduler starts to observe persistent volume claims.
1. a new api field was introduced to allow per pod protection config.
1. rbac had to be adjusted (+persistentvolumeclaims).
2025-10-29 11:21:10 +01:00
Jan Chaloupka 6567f01e86 [nodeutilization]: actual usage client through kubernetes metrics 2024-11-20 14:30:46 +01:00
Simon ScharfandGitHub 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
Hao Fan d25cba08a9 [e2e] abstract common methods 2024-09-19 21:51:11 +08: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
Jan Chaloupka 287d1b1573 test: generate uid when building a pod
UID is an integral part of every pod.
Even though we don't test for UID in any of the existing test cases,
future test cases might rely on it.
2024-07-02 14:30:42 +02:00
Niki ManoledakiandGitHub 749e81c51c Check whether pod matches the inter-pod anti-affinity of another Pod in a given Node in NodeFit() (#1356)
* Check if Pod matches inter-pod anti-affinity of other pod on node as part of NodeFit()

* Add unit tests for checking inter-pod anti-affinity match in NodeFit()
* Export setPodAntiAffinity() helper func to test utils

* Add docs for inter-pod anti-affinity in README

* Refactor logic for inter-pod anti-affinity to use in multiple pkgs
* Move logic for finding match between pods with antiaffinity out of framework to reuse in other pkgs
* Move interpod antiaffinity funcs to pkg/utils/predicates.go

* Add unit tests for inter-pod anti-affinity check
* Test logic in GroupByNodeName
* Test NodeFit() case where pods matches inter-pod anti-affinity
* Test for inter-pod anti-affinity pods  match terms, have label selector

* NodeFit inter-pod anti-affinity check returns early if affinity spec not set
2024-03-12 19:50:03 -07:00
Amir Alavi bf2bd73f64 topologyspreadconstraint: refactor to match scheduler's struct and initialization
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2023-10-30 09:16:14 -04:00
Furkan 99868a41de run: gofumpt -w -extra .
Enable gofumpt in golangci

Signed-off-by: Furkan <furkan.turkal@trendyol.com>
2022-11-07 09:11:27 +03:00
Jan Chaloupka 079bd6157b e2e: TestLowNodeUtilization: normalize nodes before running the strategy 2021-04-14 09:03:15 +02:00
ZongqiangZhang 81b816d4a4 support extended resources in lownodeutilization 2021-04-02 21:37:51 +08:00
Sean Malloy 92740a25d4 Add Initial Unit Tests For StatefulSets 2021-03-23 09:24:08 -05:00
lixiang 7457626f62 Move helper funcs to testutil 2020-06-16 19:17:28 +08:00
Jan Chaloupka 414554ae5e lownodeutilization: make unit tests with/without priority table driven 2020-04-17 11:32:28 +02:00
Jan Chaloupka d065f9904b Critical pod annotation scheduler.alpha.kubernetes.io/critical-pod has been drop, no need to set it anymore in the tests 2020-02-07 16:29:44 +01:00
Sebastiaan Tammer 164d2b0729 Minor typo corrected 2019-05-25 11:40:03 +02:00
Sebastiaan Tammer 023a2f2a47 Replaced UID with Namespace for duplicate check, added tests (+ cleanup) 2019-05-25 11:18:11 +02:00
ravisantoshgudimetla d0305dac3f Low node utilization to respect priority while evicting pods 2018-08-21 14:14:26 -04:00
Avesh Agarwal 44752e5e83 Update code and hack dir for kube 1.9 rebase. 2018-01-09 12:41:01 -05:00
ravisantoshgudimetla bf29a6073f Owner ref switch
Signed-off-by: ravisantoshgudimetla <ravisantoshgudimetla@gmail.com>
2018-01-05 00:22:12 +05:30
ravisantoshgudimetla 6f873d5e69 Make GPU requested pods not evictable by descheduler 2017-12-05 03:49:47 -05:00
ravisantoshgudimetla 9e536da99e Commit for gofmt
Signed-off-by: ravisantoshgudimetla <ravisantoshgudimetla@gmail.com>
2017-10-05 16:03:28 -04:00
ravisantoshgudimetla c1140e7b02 Changes and file reorganization 2017-09-13 16:18:39 -04:00