Commit Graph
53 Commits
Author SHA1 Message Date
Jan Chaloupka e283c31030 [nodeutilization]: prometheus usage client with prometheus metrics 2025-03-17 16:25:17 +01:00
Jan Chaloupka e14b86eb8c [nodeutilization]: allow to set a metrics source as a string so it can be later extended for exclusive configuration 2025-03-13 18:00:27 +01:00
Jan Chaloupka 5bf11813e6 lownodeutilization: evictionLimits to limit the evictions per plugin
In some cases it might be usefull to limit how many evictions per a
domain can be performed. To avoid burning the whole per descheduling
cycle budget. Limiting the number of evictions per node is a
prerequisite for evicting pods whose usage can't be easily subtracted
from overall node resource usage to predict the final usage. E.g. when a
pod is evicted due to high PSI pressure which takes into account many
factors which can be fully captured by the current predictive resource
model.
2025-03-07 15:31:02 +01:00
Jan Chaloupka 50dd3b8971 ReferencedResourceList: alias for map[v1.ResourceName]*resource.Quantity to avoid the type definition duplication 2025-03-07 13:13:00 +01:00
googs1025 e6d0caa1bc feature(descheduler): add grace_period_seconds for DeschedulerPolicy 2025-01-07 10:16:47 +08:00
googs1025 bbffb830b9 feature(eviction): add event when EvictPod failed 2024-12-07 19:38:20 +08:00
Jan Chaloupka 6567f01e86 [nodeutilization]: actual usage client through kubernetes metrics 2024-11-20 14:30:46 +01:00
Jan Chaloupka cb0c1b660d Plugin args: tag arguments with omitempty to reduce the marshalled json size 2024-08-06 15:20:18 +02:00
zhifei92 e60f525ec6 feat: support MaxNoOfPodsToEvictTotal 2024-07-09 14:00:27 +08:00
Mike Dame d9316d1872 Add json tags to internal fields and basic config test 2023-04-24 12:54:43 +00:00
Jan Chaloupka 76e7e4f57b Drop Evict extension point
The Evict extension point is not currently in use.
All DefaultEvictor plugin functionality is exposed through Filter and
PreEvictionFilter extension points instead.
Thus, no need to limit the number of evictors enabled.
2023-04-20 17:52:40 +02:00
Jan ChaloupkaandGitHub bcc6c8eb2a Descheduling profile with PoC fake plugin (#1093)
* Descheduling profile

* Fake plugin + profile unit testing

* Rename Profile config type into DeschedulerProfile

To avoid resamblance with profileImpl

* First run deschedule, then balance extension points
2023-03-23 09:14:33 -07:00
6e953b2ff3 Separate migration of strategy configuration from the constructing and running the plugins (#999)
* Remove log level from Errors

Every error printed via Errors is expected to be important and always
printable.

* Invoke first Deschedule and then Balance extension points (breaking change)

* Separate plugin arg conversion from pluginsMap

* Seperate profile population from plugin execution

* Convert strategy params into profiles outside the main descheduling loop

Strategy params are static and do not change in time.

* Bump the internal DeschedulerPolicy to v1alpha2

Drop conversion from v1alpha1 to internal

* add tests to v1alpha1 to internal conversion

* add tests to strategyParamsToPluginArgs params wiring

* in v1alpha1 evictableNamespaces are still Namespaces

* add test passing in all params

Co-authored-by: Lucas Severo Alves <lseveroa@redhat.com>
2022-11-14 08:48:41 -08: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
Lucas Severo Alves f47c2c4407 add new preevectionfilter plugin with args 2022-09-12 16:56:21 +02:00
Lucas Severo Alves a2dd86ac3b Migrate RemovePodsViolatingInterPodAntiAffinity into a plugin 2022-08-16 12:29:25 +02:00
Amir Alavi abf5752260 PodLifeTime: add States field and deprecate PodStatusPhases 2022-06-25 15:13:18 -04:00
Kubernetes Prow RobotandGitHub cf59d08193 Merge pull request #751 from HelmutLety/redo_#473
feat: Add DeviationThreshold Paramter for LowNodeUtilization, (Previous attempt - #473 )
2022-03-28 03:53:24 -07:00
HelmutLety 2ea65e69dc feat(LowNodeUtilization): useDeviationThresholds, redo of #473
[751]: normalize Percentage in nodeutilization and clean the tests
2022-03-28 12:35:01 +02:00
Jacob Henner ac3362149b Add RemovePodsViolatingNodeTaints taint exclusion
Add taint exclusion to RemovePodsViolatingNodeTaints. This permits node
taints to be ignored by allowing users to specify ignored taint keys or
ignored taint key=value pairs.
2022-03-27 13:48:40 -04:00
Jan Chaloupka 285523f0d9 RemovePodsViolatingNodeTaints: optionally include PreferNoSchedule taint 2022-03-14 16:46:03 +01:00
babygoat 1529180d70 feat: support eviction of failed bare pods
This patch adds the policy(evictFailedBarePods) to allow the failed
pods without ownerReferences to be evicted. For backward compatibility,
disable the policy by default. Address #644.
2022-01-06 01:07:41 +08:00
Kubernetes Prow RobotandJane Liu L 82201d0e48 Add maxNoOfPodsToEvictPerNamespace policy 2021-12-03 10:58:37 +08:00
Jan Chaloupka 73a7adf572 Drop deprecated flags 2021-11-29 17:12:59 +01:00
Amir Alavi 0e0e688fe8 Introduce RemoveFailedPods strategy 2021-08-30 14:17:52 -04:00
RyanDevlinandRyan Devlin 41d46d0d3b Working nodeFit feature 2021-05-24 09:03:38 -04:00
RyanDevlin b5d7219391 Completed evictSystemCriticalPods feature 2021-03-29 23:13:05 -04:00
lixiang 2517268b1f API: Add a new parameter labelSelector to StrategyParameters. 2021-02-26 15:49:00 +08:00
Kubernetes Prow RobotandGitHub 241f1325c9 Merge pull request #481 from damemi/ignore-pvc-pods
Add option to ignore pods with PVCs from eviction
2021-01-26 22:41:40 -08:00
Mike Dame c1a63a557a Add option to ignore pods with PVCs from eviction 2021-01-26 08:47:54 -05:00
lixiang 8ba9cb1df7 Add a parameter to include soft topology spread constraints 2021-01-21 11:33:16 +08:00
lixiang 1303fe6eb9 PodLifeTime: allow custom podStatusPhases 2020-09-11 09:56:45 +08:00
Jan Chaloupka 89541f7545 Deprecate node-selector, max-pods-to-evict-per-node and evict-local-storage-pods flags and promote then to policy v1alpha1 fields 2020-08-21 13:27:40 +02:00
Jan Chaloupka a7c51ffae0 Promote Namespaces field to a pointer 2020-08-13 18:38:46 +02:00
lixiang ae38aa63af StrategyParameters: Add new param ThresholdPriority and ThresholdPriorityClassName 2020-08-07 13:53:29 +08:00
Jan Chaloupka 11f1333af7 ListPodsOnANode: allow to include/exclude namespaces
Info: field selector is still not properly mocked so it's not possible to unit test it
2020-07-21 15:08:05 +02: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 c6ff87dbd6 Consider pod image in duplicates strategy
This increases the specificity of the RemoveDuplicates strategy by
removing pods which not only have the same owner, but who also
must have the same list of container images. This also adds a
parameter, `ExcludeOwnerKinds` to the RemoveDuplicates strategy
which accepts a list of Kinds. If a pod has any of these Kinds as
an owner, that pod is not considered for eviction.
2020-05-15 09:37:09 -04:00
Sean Malloy 423ee35846 Add New PodLifeTime Strategy
The new PodLifeTime descheduler strategy can be used to evict pods that
were created more than the configured number of seconds ago.

In the below example pods created more than 24 hours ago will be evicted.
````
apiVersion: "descheduler/v1alpha1"
kind: "DeschedulerPolicy"
strategies:
  "PodLifeTime":
     enabled: true
     params:
        maxPodLifeTimeSeconds: 86400
````
2020-05-07 23:10:36 -05:00
Mike Dame fa335c782f Switch PodsHavingTooManyRestarts params to pointer 2020-05-06 13:29:05 -04: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
Mike Dame e7c42794a0 Add RemovePodsHavingTooManyRestarts strategy 2020-04-24 10:48:28 -04:00
Shubham Minglani 40bb490f4c add RemovePodsViolatingNodeAffinity strategy
This commit adds requiredDuringSchedulingIgnoredDuringExecution
for RemovePodsViolatingNodeAffinity strategy.

Also adds unit tests and documentation.
2018-02-19 16:20:59 +05:30
Avesh Agarwal 44752e5e83 Update code and hack dir for kube 1.9 rebase. 2018-01-09 12:41:01 -05:00
Avesh Agarwal d634701250 Descheduler related modifications. 2017-09-15 14:13:27 -04:00
Avesh Agarwal a6b75a2fd5 Fix compilation issue by importing time. 2017-08-06 16:02:13 -04:00
Avesh Agarwal 718efe69e1 Move ReschedulingInterval to rescheduler's configuration out of
rescheduler's policy.
2017-08-06 15:58:30 -04:00
Avesh Agarwal 6178d99993 Modify percentage type to float64 2017-08-04 14:05:14 -04:00
Avesh Agarwal b2bfb0e24f Add number of nodes thershold to node utilization strategies. 2017-08-04 14:01:55 -04:00
Avesh Agarwal 79985395d5 Update rescheduler's implementation. 2017-08-04 11:55:20 -04:00