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

Update rescheduler strategies types.

This commit is contained in:
Avesh Agarwal
2017-08-04 09:59:40 -04:00
parent 4be75d86f6
commit 02382b61f7
2 changed files with 47 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ import (
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/api"
)
type ReschedulerPolicy struct {
@@ -30,14 +30,13 @@ type ReschedulerPolicy struct {
ReschedulingInterval time.Duration
// Strategies
Strategies []ReschedulerStrategy
Strategies StrategyList
}
type StrategyName string
type StrategyList map[StrategyName]ReschedulerStrategy
type ReschedulerStrategy struct {
// Name of strategy
Name string
// Enabled or disabled
Enabled bool
@@ -48,10 +47,15 @@ type ReschedulerStrategy struct {
Params StrategyParameters
}
type percentage int
type ResourceUtilizationThresholds map[v1.ResourceName]percentage
// Only one of its members may be specified
type StrategyParameters struct {
ResourceUtilizationThresholds *ResourceUtilizationThresholds
NodeResourceUtilizationThresholds *NodeResourceUtilizationThresholds
}
type Percentage int
type ResourceThresholds map[api.ResourceName]Percentage
type NodeResourceUtilizationThresholds struct {
Thresholds ResourceThresholds
TargetThresholds ResourceThresholds
}