diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index e72e72feb19..21182ae453b 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -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" @@ -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