-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatadog-agent.yaml
More file actions
161 lines (161 loc) · 4.05 KB
/
Copy pathdatadog-agent.yaml
File metadata and controls
161 lines (161 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
# Tero Edge ConfigMap
# Contains configuration and policies for the edge proxy
apiVersion: v1
kind: ConfigMap
metadata:
name: tero-edge-config
data:
config.json: |
{
"listen_address": "0.0.0.0",
"listen_port": 8080,
"upstream_url": "https://agent-http-intake.logs.us5.datadoghq.com",
"log_level": "info",
"max_body_size": 1048576,
"policy_providers": [
{
"id": "file",
"type": "file",
"path": "/etc/tero/policies.json"
}
]
}
policies.json: |
{
"policies": [
{
"id": "drop-echo-logs",
"name": "drop-echo-logs",
"enabled": true,
"log": {
"match": [{ "log_attribute": "ddsource", "regex": "nginx" }],
"keep": "none"
}
},
{
"id": "drop-no-such-file-or-directory-logs",
"name": "drop-no-such-file-or-directory-logs",
"enabled": true,
"log": {
"match": [{ "log_field": "body", "regex": "no such file or directory" }],
"keep": "none"
}
},
{
"id": "drop-debug-level",
"name": "drop-debug-level",
"enabled": true,
"log": {
"match": [{ "log_field": "severity_text", "regex": "DEBUG" }],
"keep": "none"
}
},
{
"id": "keep-error-logs",
"name": "keep-error-logs",
"enabled": true,
"log": {
"match": [
{ "log_field": "severity_text", "regex": "error" },
{ "log_field": "severity_text", "regex": "critical" },
{ "log_field": "severity_text", "regex": "fatal" }
],
"keep": "all"
}
}
]
}
---
# Tero Edge DaemonSet
# Runs the edge proxy on each node alongside the Datadog Agent
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: tero-edge
labels:
app: tero-edge
spec:
selector:
matchLabels:
app: tero-edge
template:
metadata:
labels:
app: tero-edge
spec:
containers:
- name: tero-edge
image: ghcr.io/usetero/edge:1.10.1
imagePullPolicy: IfNotPresent
args:
- /etc/tero/config.json
ports:
- containerPort: 8080
hostPort: 8080
name: http
protocol: TCP
resources:
requests:
cpu: 50m
memory: 32Mi
limits:
cpu: 200m
memory: 64Mi
volumeMounts:
- name: tero-edge-config
mountPath: /etc/tero
readOnly: true
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 2
periodSeconds: 5
volumes:
- name: tero-edge-config
configMap:
name: tero-edge-config
tolerations:
# Run on all nodes including control plane
- operator: Exists
---
# DatadogAgent CRD
# Configures the Datadog Agent to send logs through Tero Edge
apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
name: datadog
spec:
global:
site: us5.datadoghq.com
credentials:
apiSecret:
secretName: datadog-secret
keyName: api-key
clusterName: jacob-local
tags:
- "env:staging"
features:
logCollection:
enabled: true
containerCollectAll: true
override:
nodeAgent:
# Point logs to Tero Edge running on the same node via hostPort
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_LOGS_CONFIG_LOGS_DD_URL
value: "http://$(HOST_IP):8080"
# - name: DD_LOGS_CONFIG_LOGS_DD_URL
# value: "http://host.docker.internal:8080"
# Ensure agent runs on same nodes as Tero Edge
tolerations:
- operator: Exists