Skip to content

Commit

Permalink
Fix: Set Karpenter Consolidation Timeouts to zero (#1863)
Browse files Browse the repository at this point in the history
  • Loading branch information
edibble21 authored Dec 6, 2024
1 parent d3907af commit 8d819c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/disruption/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion pkg/controllers/disruption/multinodeconsolidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
)

const MultiNodeConsolidationTimeoutDuration = 1 * time.Minute
const MultiNodeConsolidationType = "multi"

type MultiNodeConsolidation struct {
consolidation
Expand Down Expand Up @@ -224,5 +225,5 @@ func (m *MultiNodeConsolidation) Class() string {
}

func (m *MultiNodeConsolidation) ConsolidationType() string {
return "multi"
return MultiNodeConsolidationType
}
3 changes: 2 additions & 1 deletion pkg/controllers/disruption/singlenodeconsolidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -108,5 +109,5 @@ func (s *SingleNodeConsolidation) Class() string {
}

func (s *SingleNodeConsolidation) ConsolidationType() string {
return "single"
return SingleNodeConsolidationType
}

0 comments on commit 8d819c1

Please sign in to comment.