Skip to content

Commit d021c9c

Browse files
Merge pull request #642 from tiraboschi/noEvictionPolicy
[RelieveAndMigrate] configure Mandatory noEvictionPolicy
2 parents 0fd6d8f + 7d4e625 commit d021c9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+580
-312
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ By default, this profile configures the descheduler to restrict the maximum numb
211211
the maximum number of evictions per node to 2 aligning with KubeVirt defaults around concurrent live migrations.
212212
Those two values can be customized with `evictionLimits.total` and `evictionLimits.node` parameters.
213213

214+
This profile configures the `DefaultEvictor` plugin with a `Mandatory noEvictionPolicy`. As a result, the `descheduler.alpha.kubernetes.io/prefer-no-eviction` annotation can be dynamically applied to VM templates and/or VMIs to exclude them from the descheduler's scope.
215+
214216
### EvictPodsWithPVC
215217
By default, the operator prevents pods with PVCs from being evicted. Enabling this
216218
profile in combination with any of the above profiles allows pods with PVCs to be

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
2727
sigs.k8s.io/controller-runtime v0.20.4
2828
sigs.k8s.io/controller-tools v0.17.3
29-
sigs.k8s.io/descheduler v0.33.1-0.20250504164356-5ce857b3fd0a
29+
sigs.k8s.io/descheduler v0.33.1-0.20250731121316-419fe74702df
3030
sigs.k8s.io/structured-merge-diff/v4 v4.6.0
3131
)
3232

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+
385385
sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
386386
sigs.k8s.io/controller-tools v0.17.3 h1:lwFPLicpBKLgIepah+c8ikRBubFW5kOQyT88r3EwfNw=
387387
sigs.k8s.io/controller-tools v0.17.3/go.mod h1:1ii+oXcYZkxcBXzwv3YZBlzjt1fvkrCGjVF73blosJI=
388-
sigs.k8s.io/descheduler v0.33.1-0.20250504164356-5ce857b3fd0a h1:V9lnfHV189jjWC489eu5zB3ONvJPoUI3LurpHqE1NfE=
389-
sigs.k8s.io/descheduler v0.33.1-0.20250504164356-5ce857b3fd0a/go.mod h1:rziKLwEllK+dLu0W5VEBURvv9xhl1y111eEiYGMMsII=
388+
sigs.k8s.io/descheduler v0.33.1-0.20250731121316-419fe74702df h1:H0bBlA2wcWdM5PCrwAkJdyJNM+fmdjuMsJv4s3Aio/U=
389+
sigs.k8s.io/descheduler v0.33.1-0.20250731121316-419fe74702df/go.mod h1:rziKLwEllK+dLu0W5VEBURvv9xhl1y111eEiYGMMsII=
390390
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
391391
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
392392
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 h1:PFWFSkpArPNJxFX4ZKWAk9NSeRoZaXschn+ULa4xVek=

pkg/operator/target_config_reconciler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,7 @@ func relieveAndMigrateProfile(profileCustomizations *deschedulerv1.ProfileCustom
10651065
Object: &defaultevictor.DefaultEvictorArgs{
10661066
IgnorePvcPods: false, // evict pvc pods by default
10671067
EvictLocalStoragePods: true, // evict pods with local storage by default
1068+
NoEvictionPolicy: defaultevictor.MandatoryNoEvictionPolicy,
10681069
},
10691070
},
10701071
},

pkg/operator/testdata/assets/relieveAndMigrateDefaults.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

pkg/operator/testdata/assets/relieveAndMigrateDeviationLowWithCombinedMetrics.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

pkg/operator/testdata/assets/relieveAndMigrateDynamicThresholdsHigh.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

pkg/operator/testdata/assets/relieveAndMigrateDynamicThresholdsLow.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

pkg/operator/testdata/assets/relieveAndMigrateDynamicThresholdsMedium.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

pkg/operator/testdata/assets/relieveAndMigrateEvictionLimits.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ profiles:
3030
name: LowNodeUtilization
3131
- args:
3232
evictLocalStoragePods: true
33+
noEvictionPolicy: Mandatory
3334
name: DefaultEvictor
3435
plugins:
3536
balance:

0 commit comments

Comments
 (0)