- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
In Kubernetes, Datadog tracers can send data to the Datadog Agent in three ways: Unix Domain Socket (UDS), host IP, or a Kubernetes service. Each option ensures that when an application pod sends APM data, the data arrives at a Datadog Agent pod on the same node. This strategy is meant to properly balance traffic and ensure the correct tagging of your data. Datadog recommends that you use UDS to send data.
However, if the hostPath
volumes required for UDS (and the hostPort
ports required for using host IP) are not available, you can use a Kubernetes service as an alternative option.
This guide describes how to configure using a Kubernetes service to send data to the Datadog Agent.
In Kubernetes 1.22, the Internal Traffic Policy feature provides the option to set the configuration internalTrafficPolicy: Local
on a service. When set, traffic from an application pod is directed to the service’s downstream pod on the same node.
If you installed the Datadog Agent by using the Datadog Helm chart or Datadog Operator on clusters with Kubernetes v1.22.0+, a service for the Agent with internalTrafficPolicy: Local
is automatically created for you. You additionally need to enable the APM port option for your Agent with the below configuration.
Update your datadog-agent.yaml
to set features.apm.enabled
to true
.
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
#(...)
features:
apm:
enabled: true
변경한 후 다음 명령을 사용해 새 구성을 적용하세요.
kubectl apply -n $DD_NAMESPACE -f datadog-agent.yaml
Update your datadog-values.yaml
to set datadog.apm.portEnabled
to true
.
datadog:
apm:
portEnabled: true
After making your changes, upgrade your Datadog Helm chart using the following command:
helm upgrade -f datadog-values.yaml <RELEASE NAME> datadog/datadog
You can configure your application to use the Kubernetes service by using the Cluster Agent Admission Controller, or with a manual configuration.
The Cluster Agent’s Admission Controller can inject the configuration for APM connectivity into your containers. The options are hostip
, socket
, or service
. Choose the service
mode to have the Admission Controller add the DD_AGENT_HOST
environment variable for the DNS name of the service.
Update your datadog-agent.yaml
with the following:
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
#(...)
features:
apm:
enabled: true
admissionController:
enabled: true
agentCommunicationMode: service
변경한 후 다음 명령을 사용해 새 구성을 적용하세요.
kubectl apply -n $DD_NAMESPACE -f datadog-agent.yaml
Update your datadog-values.yaml
with the following:
clusterAgent:
admissionController:
enabled: true
configMode: service
After making your changes, upgrade your Datadog Helm chart using the following command:
helm upgrade -f datadog-values.yaml <RELEASE NAME> datadog/datadog
Note: In mixed node (Linux/Windows) environments, the Cluster Agent and its Admission Controller are relative to the Linux deployment. This may inject the wrong environment variables for the service connectivity in the Windows pods.
For manual configuration, set the environment variable DD_AGENT_HOST
within your pod manifest, with a value of <SERVICE_NAME>.<SERVICE_NAMESPACE>.svc.cluster.local
.
#(...)
spec:
containers:
- name: "<CONTAINER_NAME>"
image: "<CONTAINER_IMAGE>"
env:
- name: DD_AGENT_HOST
value: <SERVICE_NAME>.<SERVICE_NAMESPACE>.svc.cluster.local
Replace <SERVICE_NAME>
with the service’s name, and replace <SERVICE_NAMESPACE>
with the service’s namespace.
For example, if your service definition looks like the following:
apiVersion: v1
kind: Service
metadata:
name: datadog
namespace: monitoring
labels:
#(...)
spec:
selector:
app: datadog
ports:
- protocol: UDP
port: 8125
targetPort: 8125
name: dogstatsdport
- protocol: TCP
port: 8126
targetPort: 8126
name: traceport
internalTrafficPolicy: Local
Then set the value of DD_AGENT_HOST
to datadog.monitoring.svc.cluster.local
.
#(...)
spec:
containers:
- name: "<CONTAINER_NAME>"
image: "<CONTAINER_IMAGE>"
env:
- name: DD_AGENT_HOST
value: datadog.monitoring.svc.cluster.local
추가 유용한 문서, 링크 및 기사: