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 Aug 24, 2021
1 parent b687bea commit d97bbbc
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 @@ -33,6 +33,7 @@ import (

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

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apiserver/pkg/server/mux"
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 d97bbbc

Please sign in to comment.