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

chore: log average and assessed thresholds

when calculating the average an applying the deviations it would be nice
to also see the assessed values.

this commit makes the descheduler logs these values when using level 3.
This commit is contained in:
Ricardo Maraschini
2025-03-27 15:22:28 +01:00
parent 7542cac9d0
commit 98e6ed6587
3 changed files with 40 additions and 35 deletions

View File

@@ -92,16 +92,6 @@ func NewLowNodeUtilization(
)
}
// underCriteria and overCriteria are slices used for logging purposes.
// we assemble them only once.
underCriteria, overCriteria := []any{}, []any{}
for name := range args.Thresholds {
underCriteria = append(underCriteria, name, args.Thresholds[name])
}
for name := range args.TargetThresholds {
overCriteria = append(overCriteria, name, args.TargetThresholds[name])
}
podFilter, err := podutil.
NewOptions().
WithFilter(handle.Evictor().Filter).
@@ -127,8 +117,8 @@ func NewLowNodeUtilization(
return &LowNodeUtilization{
handle: handle,
args: args,
underCriteria: underCriteria,
overCriteria: overCriteria,
underCriteria: thresholdsToKeysAndValues(args.Thresholds),
overCriteria: thresholdsToKeysAndValues(args.TargetThresholds),
resourceNames: resourceNames,
extendedResourceNames: extendedResourceNames,
podFilter: podFilter,