Skip to content

[BUG] getting warning message "Ambiguous cloud provider: kubelet or AWS" since Datadog Agent upgraded to 7.71.2 #42633

@identificator1

Description

@identificator1

Since Datadog Agent was upgraded to 7.71.2 getting warning message "Ambiguous cloud provider: kubelet or AWS". (running k8s via EKS in AWS). I believe this is related to GetHostAliases functions updated in this PR: b8b777a#diff-7abe4945c10355da68b63734acb25a821c11316e042984b6267dd5ab986bd463L122-L123

func GetHostAliases(ctx context.Context) ([]string, string) {
	aliases := []string{}
	cloudprovider := ""

While using k8s on AWS EKS function getting host alias twice (both kubelet and AWS cloud provider) here https://github.com/DataDog/datadog-agent/blob/main/pkg/util/cloudproviders/cloudproviders.go#L117

var hostAliasesDetectors = []cloudProviderAliasesDetector{
	{name: "config", callback: getValidHostAliases},
	{name: alibaba.CloudProviderName, callback: alibaba.GetHostAliases},
	{name: ec2.CloudProviderName, callback: ec2.GetHostAliases},
	{name: azure.CloudProviderName, callback: azure.GetHostAliases},
	{name: gce.CloudProviderName, callback: gce.GetHostAliases},
	{name: cloudfoundry.CloudProviderName, callback: cloudfoundry.GetHostAliases},
	{name: "kubelet", callback: kubelet.GetHostAliases},
	{name: tencent.CloudProviderName, callback: tencent.GetHostAliases},
	{name: oracle.CloudProviderName, callback: oracle.GetHostAliases},
	{name: ibm.CloudProviderName, callback: ibm.GetHostAliases},
	{name: kubernetes.CloudProviderName, callback: kubernetes.GetHostAliases},
}

in datadog / values.yaml having

    agent:
      env:
        - name: DD_CLOUD_PROVIDER_METADATA
          value: "aws"

providers:
  eks:
    ec2:
      useHostnameFromFile: true

Agent Environment
AWS cloud provider
EKS with k8s 1.34
Datadog Agent - 7.71.2

Describe what happened:
Getting Warning message "Ambiguous cloud provider: kubelet or AWS" since Datadog Agent upgraded to 7.71.2 (previousy was 7.67.0)

Describe what you expected:
No warning message

Steps to reproduce the issue:
Run k8s on EKS in AWS with Datadog agent 7.71.2 - each request for getting host id will trigger warning message (each 30 minutes one per host).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions