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

1805 Commits

Author SHA1 Message Date
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
Kubernetes Prow Robot
b8e3c0bba3 Merge pull request #1642 from ingvagabund/unconstrainedevictions
lownodeutilization: evictionLimits to limit the evictions per plugin
2025-03-10 08:43:47 -07: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
Kubernetes Prow Robot
d883c8a9e1 Merge pull request #1640 from ingvagabund/referenced-resource-list
ReferencedResourceList: alias for map[v1.ResourceName]*resource.Quantity to avoid the type definition duplication
2025-03-07 05:05:46 -08: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
Kubernetes Prow Robot
fd9f2b4614 Merge pull request #1637 from googs1025/chore/fix
chore: add setDefaultEvictor return an error
2025-03-05 00:47:45 -08:00
googs1025
655ab516c7 chore: add error handle for setDefaultEvictor func 2025-02-26 22:34:57 +08:00
googs1025
0d5301ead2 chore: add continue for GetNodeWeightGivenPodPreferredAffinity func 2025-02-25 09:26:02 +08:00
Kubernetes Prow Robot
d97f1c9057 Merge pull request #1636 from ricardomaraschini/plugin-sample
chore: add descheduler plugin example
2025-02-24 10:40:31 -08:00
Ricardo Maraschini
57a04aae9f chore: add descheduler plugin example
This commit adds a sample plugin implementation as follow:

This directory provides an example plugin for the Kubernetes Descheduler,
demonstrating how to evict pods based on custom criteria. The plugin targets
pods based on:

* **Name Regex:** Pods matching a specified regular expression.
* **Age:** Pods older than a defined duration.
* **Namespace:** Pods within or outside a given list of namespaces (inclusion
  or exclusion).

To incorporate this plugin into your Descheduler build, you must register it
within the Descheduler's plugin registry. Follow these steps:

1.  **Register the Plugin:**
    * Modify the `pkg/descheduler/setupplugins.go` file.
    * Add the following registration line to the end of the
      `RegisterDefaultPlugins()` function:

    ```go
    pluginregistry.Register(
      example.PluginName,
      example.New,
      &example.Example{},
      &example.ExampleArgs{},
      example.ValidateExampleArgs,
      example.SetDefaults_Example,
      registry,
    )
    ```

2.  **Generate Code:**
    * If you modify the plugin's code, execute `make gen` before rebuilding the
      Descheduler. This ensures generated code is up-to-date.

3.  **Rebuild the Descheduler:**
    * Build the descheduler with your changes.

Configure the plugin's behavior using the Descheduler's policy configuration.
Here's an example:

```yaml
apiVersion: descheduler/v1alpha2
kind: DeschedulerPolicy
profiles:
- name: LifecycleAndUtilization
  plugins:
    deschedule:
      enabled:
        - Example
  pluginConfig:
  - name: Example
    args:
      regex: ^descheduler-test.*$
      maxAge: 3m
      namespaces:
        include:
        - default
```

- `regex: ^descheduler-test.*$`: Evicts pods whose names match the regular
  expression `^descheduler-test.*$`.
- `maxAge: 3m`: Evicts pods older than 3 minutes.
- `namespaces.include: - default`: Evicts pods within the default namespace.

This configuration will cause the plugin to evict pods that meet all three
criteria: matching the `regex`, exceeding the `maxAge`, and residing in the
specified namespace.
2025-02-24 18:36:13 +01:00
Kubernetes Prow Robot
f3abaf48ae Merge pull request #1632 from jandai/master
PodMatchNodeSelector: Replaced PodMatchNodeSelector implementation wi…
2025-02-18 07:00:27 -08:00
Jandai
88af72b907 PodMatchNodeSelector: Replaced PodMatchNodeSelector implementation with k8s.io/component-helpers to reduce code size and optimize 2025-02-16 16:48:21 +08:00
Kubernetes Prow Robot
fa3fb4e954 Merge pull request #1612 from LukeCarrier/fix-otel-tracing
tracing: test for and address semconv/SDK version conflicts
2025-01-24 11:09:23 -08:00
Luke Carrier
d5b609b34a tracing: bump otel semconv to 1.26
Fix:

    E0122 20:09:35.824338  267288 tracing.go:130] "failed to create traceable resource" err=<
            1 errors occurred detecting resource:
                    * conflicting Schema URL: https://opentelemetry.io/schemas/1.24.0 and https://opentelemetry.io/schemas/1.26.0
     >
    E0122 20:09:35.824366  267288 server.go:108] "failed to create tracer provider" err=<
            1 errors occurred detecting resource:
                    * conflicting Schema URL: https://opentelemetry.io/schemas/1.24.0 and https://opentelemetry.io/schemas/1.26.0
     >
2025-01-22 21:14:04 +00:00
Luke Carrier
9c6604fc51 tracing: test for semconv/SDK version conflicts 2025-01-22 21:12:09 +00:00
Kubernetes Prow Robot
1a49e116df Merge pull request #1599 from linuxmaniac/vseva/1597
charts: add needed perms if metricsCollector is enabled
2025-01-10 05:54:31 -08:00
Victor Seva
4775db9e2f charts: add needed perms if metricsCollector is enabled 2025-01-10 11:58:56 +01:00
Kubernetes Prow Robot
52d5d6398c Merge pull request #1606 from googs1025/revise/e2e_test_for_flake
flake: rollback gracePeriod for evict pod in e2e test
2025-01-09 08:06:32 -08:00
googs1025
6100c914b4 fix: rollback gracePeriod for evict pod in e2e test 2025-01-09 22:29:05 +08:00
Kubernetes Prow Robot
0b3c022c32 Merge pull request #1596 from linuxmaniac/vseva/1595
charts: add missing permission for policy
2025-01-07 18:48:29 +01:00
Kubernetes Prow Robot
335c698b38 Merge pull request #1538 from googs1025/feature/grace_period_seconds
feature(descheduler): add grace_period_seconds for DeschedulerPolicy
2025-01-07 10:42:30 +01:00
Kubernetes Prow Robot
e39ae80628 Merge pull request #1602 from googs1025/chore/ut_test
chore: add ignorePvcPods param in default evictor filter unit test
2025-01-07 09:12:29 +01:00
googs1025
3440abfa41 chore: add ignorePvcPods flag in default evictor filter unit test 2025-01-07 15:27:28 +08:00
googs1025
e6d0caa1bc feature(descheduler): add grace_period_seconds for DeschedulerPolicy 2025-01-07 10:16:47 +08:00
Kubernetes Prow Robot
e085610bfd Merge pull request #1578 from googs1025/readme/update
chore: update README.md for DeschedulerPolicy
2025-01-06 13:38:16 +01:00
googs1025
03246d6843 chore: update README.md for DeschedulerPolicy 2025-01-06 20:08:35 +08:00
Victor Seva
5a201a32d9 charts: add missing permission for policy at ClusterRole
fixes 1595
2025-01-03 12:35:21 +01:00
Kubernetes Prow Robot
fc484030b9 Merge pull request #1591 from a7i/CVE-2024-45337
bump x/net and x/crypto deps for CVE-2024-45337 and CVE-2024-45338
2025-01-03 00:54:15 +01:00
Kubernetes Prow Robot
8e6be70ff9 Merge pull request #1592 from a7i/chart-image
[release v0.32.0] bump chart and images
descheduler-helm-chart-0.32.0
2025-01-03 00:26:13 +01:00
Kubernetes Prow Robot
d536cf8ed0 Merge pull request #1593 from a7i/license-2025
update license to year 2025
2025-01-02 22:54:15 +01:00
Amir Alavi
48aede9fde update license to year 2025
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-01-02 13:36:59 -05:00
Amir Alavi
bd5b95dbf9 [release v0.32.0] bump chart and images
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-01-02 13:31:18 -05:00
Amir Alavi
c02c889734 chore: update license (2024 to 2025)
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-01-02 10:07:49 -05:00
Amir Alavi
ca7afd60b9 bump x/net and x/crypto deps for CVE-2024-45337 and CVE-2024-45338
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-01-02 09:54:11 -05:00
Kubernetes Prow Robot
71726c8c85 Merge pull request #1588 from a7i/docs-1.32
[release v0.32] update docs/readme
v0.32.0
2024-12-30 06:48:13 +01:00
Amir Alavi
32e29973d8 [release v0.32] update docs/readme
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-12-29 23:19:16 -06:00
Kubernetes Prow Robot
d0fd115747 Merge pull request #1587 from a7i/k8s-1.32
[release v0.32] update kubernetes kind version to 1.32
2024-12-29 17:42:12 +01:00
Amir Alavi
da65808f77 [release v0.32] update kubernetes kind version to 1.32
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-12-27 12:07:32 -06:00
Kubernetes Prow Robot
29ff28cbb5 Merge pull request #1536 from googs1025/test
feature(eviction): add event when EvictPod failed
2024-12-17 13:18:53 +01:00
Kubernetes Prow Robot
d653537ee6 Merge pull request #1575 from a7i/bump-k8s-1.32
bump to official kubernetes v0.32.0 deps
2024-12-17 11:17:00 +01:00
Kubernetes Prow Robot
c3b9c97827 Merge pull request #1564 from pipo02mix/improve-defaults
Improve chart default values
2024-12-17 11:16:53 +01:00
Kubernetes Prow Robot
75c5c75e13 Merge pull request #1576 from seanmalloy/bump-kind-0.26.0
Bump kind to v0.26.0
2024-12-17 10:38:52 +01:00
Sean Malloy
b66b5d35f0 Bump kind to v0.26.0
The new kind version defaults to k8s v1.32.0 version when creating
new clusters.
2024-12-16 22:28:54 -06:00
Kubernetes Prow Robot
5c3a3bdcf1 Merge pull request #1573 from icloudnote/charts
Fixed the issue when successfulJobsHistoryLimit and failedJobsHistoryLimit variables are 0.
2024-12-14 19:32:42 +01:00
Kubernetes Prow Robot
46fa370ede Merge pull request #1570 from felipewnp/patch-1
docs: Removing deschedulerPolicy.strategies since it does not exist
2024-12-14 19:02:44 +01:00
Amir Alavi
4e8c7e6702 bump to official kubernetes v0.32.0 deps
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-12-13 20:03:43 -06:00
changjun
bc6323611b Fixed the issue when successfulJobsHistoryLimit and failedJobsHistoryLimit variables are 0. 2024-12-11 21:44:01 +08:00
Kubernetes Prow Robot
51a004c848 Merge pull request #1569 from a7i/bump-v0.32.0-rc.2
bump to kubernetes v0.32.0-rc.2
2024-12-11 06:48:02 +00:00
Kubernetes Prow Robot
44bde42b63 Merge pull request #1572 from seanmalloy/golangci-lint-verbose
Enable golangci-lint Verbose Output
2024-12-11 02:52:02 +00:00
googs1025
bbffb830b9 feature(eviction): add event when EvictPod failed 2024-12-07 19:38:20 +08:00