iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🐾

Installing Datadog Agent on Amazon EKS using Helm

に公開

Overview

Steps for when you want to install Datadog Agent in an Amazon EKS environment.

Procedure

wget https://raw.githubusercontent.com/DataDog/helm-charts/master/charts/datadog/values.yaml

Additionally, if you are using instance types that only support IMDSv2 for worker nodes, you need to add the following to values.yaml.

  env:
    - name: DD_EC2_PREFER_IMDSV2
      value: "true"

I learned the above from Datadog support. Since this parameter is missing by default, the Cluster name cannot be retrieved, and you will be unable to obtain various data in Datadog.

helm template datadog-agent -f values.yaml datadog/datadog \
  --namespace example \
  --set datadog.clusterName=example
helm install datadog-agent -f values.yaml datadog/datadog \
  --namespace example \
  --set datadog.clusterName=example
helm upgrade datadog-agent -f values.yaml datadog/datadog \
  --namespace example \
  --set datadog.clusterName=example

That's it.
If you are using kustomization, it seems better to manage it there since you can execute helm via kustomize.


About IMDSv2

To check whether IMDSv2 is supported, you can refer to the following article:
https://dev.classmethod.jp/articles/ec2-metadata-change/

Specifically, you can determine this by checking the metadata using the AWS CLI (excerpt from the above article):

$ aws ec2 describe-instances \
	--instance-id (Instance ID) \
	--query "Reservations[*].Instances[*].MetadataOptions"
[
    [
        {
            "State": "applied",
            "HttpTokens": "optional",
            "HttpPutResponseHopLimit": 1,
            "HttpEndpoint": "enabled",
            "HttpProtocolIpv6": "disabled",
            "InstanceMetadataTags": "disabled"
        }
    ]
]
  • If both IMDSv1 and v2 are available:
    • HttpTokens: optional
    • HttpEndpoint: enabled
  • If only IMDSv2 is available:
    • HttpTokens: required
    • HttpEndpoint: enabled
  • If IMDS is disabled:
    • HttpTokens: optional or required
    • HttpEndpoint: disabled

Discussion