Skip to content

Commit

Permalink
[local] set PodTemplateProcessor as NodeInfoProcess if enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed Sep 20, 2021
1 parent dd90210 commit e7a47e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"github.com/spf13/pflag"

"k8s.io/autoscaler/cluster-autoscaler/processors/datadog/nodeinfos/podtemplates"
"k8s.io/autoscaler/cluster-autoscaler/processors/datadog/nodeinfosprovider"
"k8s.io/autoscaler/cluster-autoscaler/processors/datadog/pods"

Expand Down Expand Up @@ -344,6 +345,11 @@ func buildAutoscaler() (core.Autoscaler, error) {
metrics.UpdateCPULimitsCores(autoscalingOptions.MinCoresTotal, autoscalingOptions.MaxCoresTotal)
metrics.UpdateMemoryLimitsBytes(autoscalingOptions.MinMemoryTotal, autoscalingOptions.MaxMemoryTotal)

// Datadog only: Configure the PodTemplateProcessor to support extra Daemonset workloads
if autoscalingOptions.NodeInfoProcessorPodTemplates {
opts.Processors.NodeInfoProcessor = podtemplates.NewNodeInfoWithPodTemplateProcessor(&opts)
}

// Datadog only: hook our "ASG template only" nodeInfos provider; not in the cleanest, but in the less
// intrusive and most rebase friendly way we can; until a "nodeInfos provider processor" makes it upstream.
core.GetNodeInfosForGroups = nodeinfosprovider.NewTemplateOnlyNodeInfoProvider().GetNodeInfosForGroups
Expand Down

0 comments on commit e7a47e3

Please sign in to comment.