From 4be75d86f6c41a26b876789e0013ce7a424d572a Mon Sep 17 00:00:00 2001 From: Avesh Agarwal Date: Thu, 3 Aug 2017 19:39:52 -0400 Subject: [PATCH] Implement resource utilization threhsolds types. --- pkg/api/types.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkg/api/types.go b/pkg/api/types.go index cc3c6601a..8068229b4 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -20,6 +20,7 @@ import ( "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/kubernetes/pkg/api/v1" ) type ReschedulerPolicy struct { @@ -27,4 +28,30 @@ type ReschedulerPolicy struct { // Time interval for rescheduler to run ReschedulingInterval time.Duration + + // Strategies + Strategies []ReschedulerStrategy +} + +type ReschedulerStrategy struct { + + // Name of strategy + Name string + + // Enabled or disabled + Enabled bool + + // Weight + Weight int + + // Strategy parameters + Params StrategyParameters +} + +type percentage int +type ResourceUtilizationThresholds map[v1.ResourceName]percentage + +// Only one of its members may be specified +type StrategyParameters struct { + ResourceUtilizationThresholds *ResourceUtilizationThresholds }