48 Commits
Author SHA1 Message Date
Amir Alavi 41fca2ed61 e2e tests for RemoveFailedPods strategy
Fix priority class default
2021-09-28 10:54:50 -04:00
Amir Alavi 8e1da96082 e2e TestTopologySpreadConstraint: ensure pods are running before checking for topology spread across domains 2021-09-28 10:51:49 -04:00
Amir Alavi 84d648ff60 Add e2e tests for TopologySpreadConstraint 2021-08-16 22:39:31 -04:00
Hanu 6e71068f4f Refractoring lownodeutilization - extracting common functions 2021-06-06 18:00:29 +08:00
Jan Chaloupka f4e24a408f Drop klog 2021-04-14 09:03:38 +02:00
Jan Chaloupka 2781106d49 TestEvictAnnotation: replace LowNodeUtilization strategy with PodLifetime
PodLifetime is simpler in validating results
2021-04-14 09:03:31 +02:00
Jan Chaloupka 534a30a058 e2e: deleteRC: replace loop with wait.PollImmediate 2021-04-14 09:03:26 +02:00
Jan Chaloupka 079bd6157b e2e: TestLowNodeUtilization: normalize nodes before running the strategy 2021-04-14 09:03:15 +02:00
Gaurav Singh 7076ba0760 e2e_test: fix goroutine leak 2021-04-04 21:19:56 -04:00
RyanDevlin b5d7219391 Completed evictSystemCriticalPods feature 2021-03-29 23:13:05 -04:00
lixiang 29ade13ce7 README and e2e-testcase add for labelSelector 2021-03-04 21:32:14 +08:00
Mike Dame c1a63a557a Add option to ignore pods with PVCs from eviction 2021-01-26 08:47:54 -05:00
wu.chaozong 1a998037f8 refactor: remove unuse param in e2e_test.go 2020-12-16 08:46:40 +08:00
Ali Farah 3ac0c408de Add --logging-format flag
Add k8s.io/component-base/config package
2020-10-12 22:27:39 +11:00
lixiang 1303fe6eb9 PodLifeTime: allow custom podStatusPhases 2020-09-11 09:56:45 +08:00
Sean Malloy 1fb3445692 Fix golangci-lint Failures For 1.30.0 Upgrade 2020-08-31 14:03:43 -05:00
Jan Chaloupka d8251b9086 Redefine IsEvictable to be customizable for a particular strategy
Use WithXXX methods to extend the list of constraints to also
provide a reasonable error message.
2020-08-19 11:21:26 +02:00
Jan Chaloupka a7c51ffae0 Promote Namespaces field to a pointer 2020-08-13 18:38:46 +02:00
lixiang 6d693d06fb e2e: add testcase for priority threshold 2020-08-12 13:55:53 +08:00
lixiang 4d7a6ee9be e2e: Add priority and priority class to runPodLifetimeStrategy and RcByNameContainer 2020-08-12 13:55:53 +08:00
lixiang 95ce2a4ff7 PodEvictor: add a new param thresholdPriority to IsEvictable 2020-08-11 09:57:26 +08:00
Jan Chaloupka c40a9c397f e2e: add test for included/excluded namespace through PodLifeTime strategy 2020-07-27 10:54:35 +02:00
Jan Chaloupka 74f70fdbc9 ListPodsOnANode: define Options type to pass various options
Options like:
- filter
- included/excluded namespaces
- labels
2020-07-21 15:07:45 +02:00
Jan Chaloupka 53badf7b61 e2e: create dedicated ns for each e2e test 2020-07-17 18:15:53 +02:00
Jan Chaloupka f801c5f72f e2e: code cleanup 2020-07-17 18:15:13 +02:00
Jan Chaloupka 327880ba51 e2e: separate tests for LowNodeUtilization strategy and evict annotation 2020-07-17 18:11:01 +02:00
Jan Chaloupka 7bb8b4feda e2e: create and delete RC in the same function body
So create/delete are coupled and caller of create is responsible for calling delete as well
2020-07-17 18:06:19 +02:00
Mike Dame f5e9f07321 Move kind setup to e2e script
This moves the kind setup (previously used by Travis) to the e2e runner script
to accomodate the switch to Prow. This provides a KIND_E2E env var to specify
whether to run the tests in kind, or (by default) to run locally).
2020-07-13 15:49:41 -04:00
Ali Farah 15fcde5229 Update klog to v2 2020-06-22 20:43:22 +10:00
Mike Dame f5e4acdd8a Make evictLocalStoragePods a property of PodEvictor
This is a minor refactor of PodEvictor to include evictLocalStoragePods as a
property (so that it doesn't need to be passed to each strategy function.) It
also removes ListEvictablePodsOnNode and extends ListPodsOnANode with an optional
"filter" function parameter, so that for example IsEvictable can be passed to it
and achieve the same results as the function formerly known as ListEvictablePodsOnNode.
This approach also now allows strategies to more explicitly extend their criteria of what
IsEvictable considers an evictable pod (such as NodeAffinity, which checks that the pod
can fit on any other node).
2020-06-05 10:28:48 -04:00
Jan Chaloupka 5a81a0661b Make DeschedulerStrategy.Params a pointer
To avoid empty params fields when serializing:
  RemoveDuplicates:
    enabled: true
    params: {}
  RemovePodsHavingTooManyRestarts:
    enabled: true
    params:
      podsHavingTooManyRestarts: {}
  RemovePodsViolatingInterPodAntiAffinity:
    enabled: true
    params: {}
  RemovePodsViolatingNodeAffinity:
    enabled: true
    params:
      nodeAffinityType:
      - requiredDuringSchedulingIgnoredDuringExecution
  RemovePodsViolatingNodeTaints:
    enabled: true
    params: {}
2020-05-27 10:31:31 +02:00
Mike Dame eec1104d6e React to 1.18 by adding contexts to client calls 2020-05-12 15:01:25 -04:00
Jan Chaloupka cbcefb5d2f Remove options.DeschedulerServer from all strategies 2020-04-28 16:13:33 +02:00
Jan Chaloupka 991eddb691 Turn StrategyParameters.NodeResourceUtilizationThresholds field into a pointer
The field is intended to be omitempty when not set. Without a pointer the strategy
serialized into json string looks like:

```json
strategies:
  LowNodeUtilization:
    enabled: true
    params:
      nodeResourceUtilizationThresholds:
        numberOfNodes: 1
        targetThresholds:
          cpu: 50
          memory: 50
          pods: 20
        thresholds:
          cpu: 50
          memory: 50
          pods: 20
  RemoveDuplicates:
    enabled: true
    params:
      nodeResourceUtilizationThresholds: {}
  RemovePodsViolatingInterPodAntiAffinity:
    enabled: true
    params:
      nodeResourceUtilizationThresholds: {}
  RemovePodsViolatingNodeAffinity:
    enabled: true
    params:
      nodeAffinityType:
      - requiredDuringSchedulingIgnoredDuringExecution
      nodeResourceUtilizationThresholds: {}
  RemovePodsViolatingNodeTaints:
    enabled: true
    params:
      nodeResourceUtilizationThresholds: {}
```

It's preferred to have the following json string instead:
```
strategies:
  LowNodeUtilization:
    enabled: true
    params:
      nodeResourceUtilizationThresholds:
        numberOfNodes: 1
        targetThresholds:
          cpu: 50
          memory: 50
          pods: 20
        thresholds:
          cpu: 50
          memory: 50
          pods: 20
  RemoveDuplicates:
    enabled: true
  RemovePodsViolatingInterPodAntiAffinity:
    enabled: true
  RemovePodsViolatingNodeAffinity:
    enabled: true
    params:
      nodeAffinityType:
      - requiredDuringSchedulingIgnoredDuringExecution
  RemovePodsViolatingNodeTaints:
    enabled: true
```
2020-04-28 15:20:30 +02:00
Jan Chaloupka 077b7f6505 Drop check for MaxNoOfPodsToEvictPerNode and invoke EvictPod wrapper instead 2020-04-22 10:33:22 +02:00
Jan Chaloupka 9593ce16d9 List nodes through informer in every iteration
Also, refactor the code a bit so it can be tested without checking for eviction support.
2020-03-04 16:26:13 +01:00
Mike Dame 431597dd43 Break dependency on k8s.io/kubernetes 2020-02-03 10:04:53 -05:00
Mike Dame 30d05382b6 Wire --descheduler-interval flag to run descheduler on a loop 2020-01-30 17:17:55 -05:00
Mike Dame 4b9e732c18 Switch from glog to klog 2019-10-28 20:44:02 -04:00
Mike Dame 5b1d551ffd update e2e test 2019-10-21 13:33:38 -04:00
ksimon1 fb1b5fc690 added unit test
updated e2e test

Signed-off-by: ksimon1 <ksimon@redhat.com>
2019-10-04 11:08:33 +02:00
Jan Chaloupka e35eb4a0b5 Run ./hack/update-gofmt 2019-09-19 14:29:00 +02:00
Jan Chaloupka 2e6f14103b Project migrared under kubernetes-sigs, change import path prefix to sigs.k8s.io/descheduler 2019-09-19 14:09:05 +02:00
Bowen Song 7245a31f52 Change hard coded leastLoadedNode=[3rd node] to searching for leastLoadedNode worker node
Accomodate https://github.com/kubernetes-incubator/descheduler/commit/dee89a6cc1ec00ed699a09ed632ca3ed68232a92

And format files according to gofmt verification

update version to 1.11.1
2019-07-11 17:26:06 -04:00
ravisantoshgudimetlaandBowen Song 66a2a87e49 Start use kind for e2e tests 2019-07-11 10:03:06 -04:00
Reeta Singh dee89a6cc1 Refactoring test by make it table driven and adding golangci-lint to the CI pipeline 2019-06-03 20:40:02 -07:00
ravisantoshgudimetlaandJan Chaloupka f1f8b2eaa7 Limit maximum number of pods to be evicted per node 2018-03-22 12:40:19 +01:00
ravisantoshgudimetla de76f9b14c E2E using gce first pass 2018-03-19 11:34:17 -04:00