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

skip eviction when replica count is below evictor minReplicas threshold setting

Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
This commit is contained in:
Amir Alavi
2023-10-06 23:31:39 -04:00
committed by Amir Alavi
parent ed1efe436f
commit 37df42df7c
7 changed files with 155 additions and 26 deletions

View File

@@ -16,6 +16,8 @@ package defaultevictor
import (
"fmt"
"k8s.io/klog/v2"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -26,5 +28,9 @@ func ValidateDefaultEvictorArgs(obj runtime.Object) error {
return fmt.Errorf("priority threshold misconfigured, only one of priorityThreshold fields can be set, got %v", args)
}
if args.MinReplicas == 1 {
klog.V(4).Info("DefaultEvictor minReplicas must be greater than 1 to check for min pods during eviction. This check will be ignored during eviction.")
}
return nil
}