Commit Graph

211 Commits

Author SHA1 Message Date
Amir Alavi
745146e411 ci(e2e): bump KubeVirt to v1.9.0-alpha.0 for k8s 1.36 compatibility
KubeVirt v1.8.2 publishes VMI status checksum fields (uint32 in Go) as
format: int32 in its generated CRD schema. k8s 1.36 enables strict
numeric format validation in CRDs via
https://github.com/kubernetes/kubernetes/pull/136582, which now rejects
the legacy schema and causes virt-handler to enter an infinite VMI
status update re-enqueue loop. Live migrations never complete and the
descheduler e2e TestLiveMigrationInBackground times out.

The schema fix landed upstream in
https://github.com/kubevirt/kubevirt/pull/17469 (merged to main on
2026-04-18, included in v1.9.0-alpha.0 tagged 2026-05-11) but was not
backported to release-1.8, so no v1.8.x release contains it. Bump the
default KUBEVIRT_VERSION to v1.9.0-alpha.0 so the e2e suite consumes a
release whose generated CRDs are compatible with k8s 1.36's stricter
validator.

Tracked in https://github.com/kubevirt/kubevirt/issues/17858.
2026-05-19 15:06:11 -04:00
Amir Alavi
2119baee3d revert: ensureVMIsLiveMigratable retry helper
Reverts b767b9c0f. The helper was added to work around what looked like
the virt-handler containerdisk-socket race on k8s 1.36, but the actual
root cause is unrelated: k8s 1.36's stricter CRD numeric format
validation (kubernetes/kubernetes#136582) rejects VMI status updates
with the pre-fix uint32 Checksum schema. See
https://github.com/kubevirt/kubevirt/issues/17858 for the upstream
context and kubevirt/kubevirt#17469 for the upstream fix (merged to
main, included in v1.9.0-alpha.0, not in v1.8.x).

The follow-up commit bumps KUBEVIRT_VERSION so the test consumes a
KubeVirt release that contains the fix, which removes the need for any
test-side retry.
2026-05-19 15:05:04 -04:00
Amir Alavi
b767b9c0f7 test(e2e): wait for VMIs to be LiveMigratable, recreate on race
Adds ensureVMIsLiveMigratable in TestLiveMigrationInBackground. After
the existing wait for virt-launcher pods to reach Running, poll each
VMI for the LiveMigratable=True condition. If a VMI fails to become
migratable within 120s, delete and recreate it (up to 3 attempts).

This works around an upstream KubeVirt race where virt-handler computes
the containerdisk checksum before the disk socket is ready, fails, and
never retries. The recreated VMI lands on a node that has already
cached the containerdisk image, so the socket comes up before
virt-handler's first attempt.

The race surfaces consistently with the kind v1.36.1 node image,
causing TestLiveMigrationInBackground to fail with "Expected at least
3 finished live migrations, got less: 0".
2026-05-19 09:16:51 -04:00
Amir Alavi
03f7dc5889 Bump KubeVirt dependencies to v1.8.2 and migrate to new client package
- Update kubevirt.io/api from v1.3.0 to v1.8.2
- Update kubevirt.io/client-go from v1.3.0 to v1.8.2
- Update kubevirt.io/containerized-data-importer-api from v1.57.0-alpha1 to v1.64.0
- Migrate e2e test from deprecated generated clientset path
  (kubevirt.io/client-go/generated/kubevirt/clientset/versioned)
  to new kubevirt.io/client-go/kubevirt client package
- Update vendor and dependencies for Kubernetes 1.36 compatibility
2026-05-18 22:39:53 -04:00
Amir Alavi
dfc3166787 test(e2e): harden kind install and align lint tooling 2026-05-18 12:15:31 -04:00
Amir Alavi
3f8f9bb74e [v0.36.0] release prep: bump k8s/go deps, manifests, docs, and CI matrix 2026-05-18 12:15:30 -04:00
Amir Alavi
a845ed3b36 Extend PodLifeTime with condition, exit code, owner kind, and transition time filters 2026-03-06 12:17:07 -05:00
Kubernetes Prow Robot
0de5bad232 Merge pull request #1827 from a7i/k8s-1.35
[v0.35.0] bump to kubernetes 1.35 deps
2026-02-18 16:31:37 +05:30
Jan Chaloupka
a868c8d129 chore: update the code based on golangci-lint report 2026-02-17 22:01:25 +01:00
Amir Alavi
a206a88d86 [v0.35.0] bump to kubernetes 1.35 deps
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2026-02-15 19:50:50 -05:00
Kubernetes Prow Robot
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
Amir Alavi
1db6b615d1 [v0.34.0] bump to kubernetes 1.34 deps
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-10-21 09:14:13 -04:00
Simone Tiraboschi
c36466bb1c test: run by default with kind 0.30.0 and kubevirt v1.6.2
bump kind and kubevirt versions to unblock the k8s 1.34
e2e test lane.

Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
2025-10-21 13:44:34 +02:00
Jan Chaloupka
fa9fa70ed7 feat(test/e2e): introduce new flags to override RunAsUser and RunAsGroup security context setting
So RunAsUser and RunAsGroup can be either omitted and set to different values
2025-09-17 10:23:57 +02:00
Jan Chaloupka
1974c12e0f Extend plugin's New with a context.Context
The new context.Context can be later used for passing a contextualized
logger. Or, other initialization steps that require the context.
2025-05-19 12:23:44 +02:00
Amir Alavi
4750dc19e6 [v0.33.0] update docs and manifests
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2025-05-01 22:06:04 -04:00
dongjiang
a249c9baf0 update k8s to v1.33
Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-04-30 22:07:02 +08:00
Jan Chaloupka
c2ed7eb575 TestLowNodeUtilizationKubernetesMetrics: set the right -cpu value for the cpu stressor 2025-04-07 10:49:04 +02: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
googs1025
6100c914b4 fix: rollback gracePeriod for evict pod in e2e test 2025-01-09 22:29:05 +08:00
googs1025
e6d0caa1bc feature(descheduler): add grace_period_seconds for DeschedulerPolicy 2025-01-07 10:16:47 +08: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
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
Sean Malloy
697ecc79e4 Bump kind version to v0.25.0 2024-12-05 22:32:46 -06:00
Jan Chaloupka
6567f01e86 [nodeutilization]: actual usage client through kubernetes metrics 2024-11-20 14:30:46 +01:00
Jan Chaloupka
3a1a3ff9d8 Introduce RequestEviction feature for evicting pods in background
When the feature is enabled each pod with descheduler.alpha.kubernetes.io/request-evict-only
annotation will have the eviction API error examined for a specific
error code/reason and message. If matched eviction of such a pod will be interpreted
as initiation of an eviction in background.
2024-11-19 15:28:37 +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
3e6166666b test: construct e2e deployments through buildTestDeployment 2024-10-01 15:23:44 +02:00
Kubernetes Prow Robot
e1e537de95 Merge pull request #1522 from fanhaouu/e2e-leaderelection
[LeaderElection] e2e: build a descheduler image and run the descheduler as a pod
2024-10-01 08:23:53 +01:00
Kubernetes Prow Robot
8e762d2585 Merge pull request #1523 from fanhaouu/e2e-topologyspreadconstraint
[TopologySpreadConstraint] e2e: build a descheduler image and run the descheduler as a pod
2024-09-30 20:37:32 +01:00
Kubernetes Prow Robot
042fef7c91 Merge pull request #1521 from fanhaouu/e2e-failedpods
[FailedPods] e2e: build a descheduler image and run the descheduler as a pod
2024-09-30 20:37:24 +01:00
Hao Fan
e0a8c77d0e e2e: DuplicatePods: build a descheduler image and run the descheduler as a pod 2024-09-23 19:37:56 +08:00
Hao Fan
05ce561a06 e2e: FailedPods: build a descheduler image and run the descheduler as a pod 2024-09-23 19:36:53 +08:00
Hao Fan
8b6a67535f remove policy_leaderelection yaml file 2024-09-23 19:36:01 +08:00
Hao Fan
0ac05f6ea3 e2e: LeaderElection: build a descheduler image and run the descheduler as a pod 2024-09-23 19:35:33 +08:00
Hao Fan
af495e65f7 e2e: TopologySpreadConstraint: build a descheduler image and run the descheduler as a pod 2024-09-23 19:33:59 +08:00
Hao Fan
d25cba08a9 [e2e] abstract common methods 2024-09-19 21:51:11 +08:00
Kubernetes Prow Robot
b35e93ec7a Merge pull request #1510 from Juneezee/chore/yaml
chore: replace `github.com/ghodss/yaml` with `sigs.k8s.io/yaml`
2024-09-09 10:08:27 +01:00
Eng Zer Jun
33868c44df chore: replace github.com/ghodss/yaml with sigs.k8s.io/yaml
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-09-08 23:48:16 +08:00
Hao Fan
ab6a3ca2d6 avoid e2e test timeout 2024-09-04 01:26:30 +08:00
Hao Fan
fdd69106a3 modify IMAGE_TAG to fix the version parsing issue 2024-09-04 01:26:20 +08:00
Amir Alavi
0cf1fc906e descheduler v0.31: update e2e test versions
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
2024-08-28 23:04:59 -04: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
cbade38d23 [tests] de-duplicate framework handle initialization 2024-08-12 17:05:30 +02:00