File tree Expand file tree Collapse file tree 5 files changed +95
-0
lines changed Expand file tree Collapse file tree 5 files changed +95
-0
lines changed Original file line number Diff line number Diff line change @@ -294,3 +294,4 @@ The Descheduler operator exposes the following parameters in its CRD:
294
294
|`mode`|`string`|Configures the descheduler to either evict pods or to simulate the eviction|
295
295
|`evictionLimits`|`map`|Restrict the number of evictions during each descheduling run. Available fields are : ` total` |
296
296
|`evictionLimits.total`|`int32`|Restricts the maximum number of overall evictions|
297
+ |`evictionLimits.node`|`int32`|Restricts the maximum number of of evictions per node|
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ type KubeDeschedulerSpec struct {
50
50
type EvictionLimits struct {
51
51
// total restricts the maximum number of overall evictions
52
52
Total * int32 `json:"total,omitempty"`
53
+
54
+ // node restricts the maximum number of evictions per node
55
+ Node * int32 `json:"node,omitempty"`
53
56
}
54
57
55
58
// ProfileCustomizations contains various parameters for modifying the default behavior of certain profiles
Original file line number Diff line number Diff line change @@ -1299,6 +1299,9 @@ func (c *TargetConfigReconciler) manageConfigMap(descheduler *deschedulerv1.Kube
1299
1299
if descheduler .Spec .EvictionLimits .Total != nil {
1300
1300
policy .MaxNoOfPodsToEvictTotal = utilptr.To [uint ](uint (* descheduler .Spec .EvictionLimits .Total ))
1301
1301
}
1302
+ if descheduler .Spec .EvictionLimits .Node != nil {
1303
+ policy .MaxNoOfPodsToEvictPerNode = utilptr.To [uint ](uint (* descheduler .Spec .EvictionLimits .Node ))
1304
+ }
1302
1305
}
1303
1306
1304
1307
if c .isPrometheusAsMetricsProviderForProfiles (descheduler ) {
Original file line number Diff line number Diff line change @@ -274,6 +274,23 @@ func TestManageConfigMap(t *testing.T) {
274
274
Data : map [string ]string {"policy.yaml" : string (bindata .MustAsset ("assets/lowNodeUtilizationHighConfig.yaml" ))},
275
275
},
276
276
},
277
+ {
278
+ name : "LowNodeUtilizationEvictionLimits" ,
279
+ descheduler : & deschedulerv1.KubeDescheduler {
280
+ Spec : deschedulerv1.KubeDeschedulerSpec {
281
+ Profiles : []deschedulerv1.DeschedulerProfile {"LifecycleAndUtilization" },
282
+ ProfileCustomizations : & deschedulerv1.ProfileCustomizations {DevLowNodeUtilizationThresholds : utilptr.To [deschedulerv1.LowNodeUtilizationThresholdsType ]("" )},
283
+ EvictionLimits : & deschedulerv1.EvictionLimits {
284
+ Total : utilptr.To [int32 ](10 ),
285
+ Node : utilptr.To [int32 ](3 ),
286
+ },
287
+ },
288
+ },
289
+ want : & corev1.ConfigMap {
290
+ TypeMeta : metav1.TypeMeta {APIVersion : "v1" , Kind : "ConfigMap" },
291
+ Data : map [string ]string {"policy.yaml" : string (bindata .MustAsset ("assets/lowNodeUtilizationEvictionLimits.yaml" ))},
292
+ },
293
+ },
277
294
{
278
295
name : "RelieveAndMigrateWithoutCustomizations" ,
279
296
descheduler : & deschedulerv1.KubeDescheduler {
Original file line number Diff line number Diff line change
1
+ apiVersion : descheduler/v1alpha2
2
+ kind : DeschedulerPolicy
3
+ maxNoOfPodsToEvictPerNode : 3
4
+ maxNoOfPodsToEvictTotal : 10
5
+ profiles :
6
+ - name : LifecycleAndUtilization
7
+ pluginConfig :
8
+ - args :
9
+ maxPodLifeTimeSeconds : 86400
10
+ namespaces :
11
+ exclude :
12
+ - kube-system
13
+ - hypershift
14
+ - openshift
15
+ - openshift-kube-descheduler-operator
16
+ - openshift-kube-scheduler
17
+ name : PodLifeTime
18
+ - args :
19
+ includingInitContainers : true
20
+ namespaces :
21
+ exclude :
22
+ - kube-system
23
+ - hypershift
24
+ - openshift
25
+ - openshift-kube-descheduler-operator
26
+ - openshift-kube-scheduler
27
+ podRestartThreshold : 100
28
+ name : RemovePodsHavingTooManyRestarts
29
+ - args :
30
+ evictableNamespaces :
31
+ exclude :
32
+ - kube-system
33
+ - hypershift
34
+ - openshift
35
+ - openshift-kube-descheduler-operator
36
+ - openshift-kube-scheduler
37
+ targetThresholds :
38
+ cpu : 50
39
+ memory : 50
40
+ pods : 50
41
+ thresholds :
42
+ cpu : 20
43
+ memory : 20
44
+ pods : 20
45
+ name : LowNodeUtilization
46
+ - args :
47
+ ignorePvcPods : true
48
+ name : DefaultEvictor
49
+ plugins :
50
+ balance :
51
+ disabled : null
52
+ enabled :
53
+ - LowNodeUtilization
54
+ deschedule :
55
+ disabled : null
56
+ enabled :
57
+ - PodLifeTime
58
+ - RemovePodsHavingTooManyRestarts
59
+ filter :
60
+ disabled : null
61
+ enabled :
62
+ - DefaultEvictor
63
+ preevictionfilter :
64
+ disabled : null
65
+ enabled : null
66
+ presort :
67
+ disabled : null
68
+ enabled : null
69
+ sort :
70
+ disabled : null
71
+ enabled : null
You can’t perform that action at this time.
0 commit comments