Kubernetes Cluster Name Automatic Detection

For Agent v6.11+, the Datadog Agent can automatically detect the Kubernetes cluster name on Google Kubernetes Engine (GKE), Azure Kubernetes Service (AKS), and Amazon Elastic Kubernetes Service (EKS). If detected, the cluster name is added as a suffix on the node name to all data collected. This facilitates the identification of nodes across Kubernetes clusters.

On GKE, the cluster name is retrieved from the cloud provider API.

On Azure AKS, the cluster name is parsed from the resource group name of the node and must conform to the pattern: (MC|mc)_<resource-group>_<cluster-name>_<zone>.

On Amazon EKS, the cluster name is retrieved from EC2 instance tags. For the Datadog Agent to query EC2 instance tags, you must add the ec2:DescribeInstances permission to your Datadog IAM policy.

Note: You can manually set this cluster name value with Agent v6.5+ by using Agent configuration parameter clusterName or the DD_CLUSTER_NAME environment variable.

PREVIEWING: may/unit-testing