From 8d819c1ddaea095d4fa9abb53b20b536c0c45802 Mon Sep 17 00:00:00 2001 From: edibble21 <85638465+edibble21@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:06:00 -0800 Subject: [PATCH] Fix: Set Karpenter Consolidation Timeouts to zero (#1863) --- pkg/controllers/disruption/metrics.go | 5 +++++ pkg/controllers/disruption/multinodeconsolidation.go | 3 ++- pkg/controllers/disruption/singlenodeconsolidation.go | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/disruption/metrics.go b/pkg/controllers/disruption/metrics.go index a288f05d66..cc6c807e99 100644 --- a/pkg/controllers/disruption/metrics.go +++ b/pkg/controllers/disruption/metrics.go @@ -30,6 +30,11 @@ const ( consolidationTypeLabel = "consolidation_type" ) +func init() { + ConsolidationTimeoutsTotal.Add(0, map[string]string{consolidationTypeLabel: MultiNodeConsolidationType}) + ConsolidationTimeoutsTotal.Add(0, map[string]string{consolidationTypeLabel: SingleNodeConsolidationType}) +} + var ( EvaluationDurationSeconds = opmetrics.NewPrometheusHistogram( crmetrics.Registry, diff --git a/pkg/controllers/disruption/multinodeconsolidation.go b/pkg/controllers/disruption/multinodeconsolidation.go index e9b74fa731..1f1947a967 100644 --- a/pkg/controllers/disruption/multinodeconsolidation.go +++ b/pkg/controllers/disruption/multinodeconsolidation.go @@ -33,6 +33,7 @@ import ( ) const MultiNodeConsolidationTimeoutDuration = 1 * time.Minute +const MultiNodeConsolidationType = "multi" type MultiNodeConsolidation struct { consolidation @@ -224,5 +225,5 @@ func (m *MultiNodeConsolidation) Class() string { } func (m *MultiNodeConsolidation) ConsolidationType() string { - return "multi" + return MultiNodeConsolidationType } diff --git a/pkg/controllers/disruption/singlenodeconsolidation.go b/pkg/controllers/disruption/singlenodeconsolidation.go index a50bd0f5de..8de9f69146 100644 --- a/pkg/controllers/disruption/singlenodeconsolidation.go +++ b/pkg/controllers/disruption/singlenodeconsolidation.go @@ -28,6 +28,7 @@ import ( ) const SingleNodeConsolidationTimeoutDuration = 3 * time.Minute +const SingleNodeConsolidationType = "single" // SingleNodeConsolidation is the consolidation controller that performs single-node consolidation. type SingleNodeConsolidation struct { @@ -108,5 +109,5 @@ func (s *SingleNodeConsolidation) Class() string { } func (s *SingleNodeConsolidation) ConsolidationType() string { - return "single" + return SingleNodeConsolidationType }