Skip to content

Commit

Permalink
[local] Hook in Datadog's podlistprocessor
Browse files Browse the repository at this point in the history
Hooking it in the less intrusive way we could.
  • Loading branch information
bpineau authored and domenicbozzuto committed Jan 18, 2024
1 parent a28f1c8 commit 5475563
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (

"github.com/spf13/pflag"

"k8s.io/autoscaler/cluster-autoscaler/processors/datadog/pods"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apiserver/pkg/server/mux"
"k8s.io/apiserver/pkg/server/routes"
Expand All @@ -43,7 +45,6 @@ import (
cloudBuilder "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/builder"
"k8s.io/autoscaler/cluster-autoscaler/config"
"k8s.io/autoscaler/cluster-autoscaler/core"
"k8s.io/autoscaler/cluster-autoscaler/core/podlistprocessor"
"k8s.io/autoscaler/cluster-autoscaler/estimator"
"k8s.io/autoscaler/cluster-autoscaler/expander"
"k8s.io/autoscaler/cluster-autoscaler/metrics"
Expand Down Expand Up @@ -457,7 +458,9 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter

opts.Processors = ca_processors.DefaultProcessors(autoscalingOptions)
opts.Processors.TemplateNodeInfoProvider = nodeinfosprovider.NewDefaultTemplateNodeInfoProvider(nodeInfoCacheExpireTime, *forceDaemonSets)
opts.Processors.PodListProcessor = podlistprocessor.NewDefaultPodListProcessor(opts.PredicateChecker)
// Explicitly hook datadog's pod list processor; preferred over the built-in one
//opts.Processors.PodListProcessor = podlistprocessor.NewDefaultPodListProcessor(opts.PredicateChecker)
opts.Processors.PodListProcessor = pods.NewFilteringPodListProcessor(opts.PredicateChecker)
scaleDownCandidatesComparers := []scaledowncandidates.CandidatesComparer{}
if autoscalingOptions.ParallelDrain {
sdCandidatesSorting := previouscandidates.NewPreviousCandidates()
Expand Down

0 comments on commit 5475563

Please sign in to comment.