-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedgedelta-agent.yml
287 lines (286 loc) · 6.78 KB
/
edgedelta-agent.yml
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
apiVersion: v1
kind: Namespace
metadata:
name: edgedelta
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: edgedelta
namespace: edgedelta
annotations:
prometheus.io/scrape: "true"
labels:
k8s-app: edgedelta-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
selector:
matchLabels:
k8s-app: edgedelta-logging
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
k8s-app: edgedelta-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
serviceAccountName: edgedelta
hostPID: true
hostNetwork: true
containers:
- name: edgedelta-agent
image: gcr.io/edgedelta/agent:v1.28.0
env:
- name: ED_API_KEY
valueFrom:
# kubectl create secret generic ed-api-key \
# --namespace=edgedelta \
# --from-literal=ed-api-key="2c7a5780-..."
secretKeyRef:
key: ed-api-key
name: ed-api-key
# Uncomment if proxy setup needed
# More details: https://github.com/golang/net/blob/master/http/httpproxy/proxy.go#L27
# - name: HTTP_PROXY
# value: my.proxy.com
# - name: NO_PROXY
# value: skip.proxy.com
# pass node hostname to agent
- name: ED_HOST_OVERRIDE
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: TRACER_SERVER_PORT
value: "9595"
- name: ED_ENABLE_TRAFFIC_TRACER
value: "1"
- name: ED_SERVICE_DNS_REQUIRED
value: "1"
- name: ED_COMPACT_SERVICE_ENDPOINT
value: ed-compactor-svc.edgedelta.svc.cluster.local:9199
command:
- /edgedelta/edgedelta
resources:
limits:
cpu: 2000m
memory: 2048Mi
requests:
cpu: 200m
memory: 256Mi
volumeMounts:
- name: varlog
mountPath: /var/log
readOnly: true
- name: varlibdockercontainers
# Some Kubernetes distributions may use /docker/containers instead of standard /var/lib/docker/containers
# Update mountPath to match the actual container log folder path
mountPath: /var/lib/docker/containers
readOnly: true
- name: persisting-cursor-storage
mountPath: /var/lib/edgedelta
- name: cgroup
mountPath: /sys/fs/cgroup
- name: debugfs
mountPath: /sys/kernel/debug
- name: netns
mountPath: /var/run/netns
- name: proc
mountPath: /proc
securityContext:
privileged: true
# Required for OpenShift or SELinux enabled K8s clusters
# runAsUser: 0
terminationGracePeriodSeconds: 10
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
# Update path below if you changed volumeMounts varlibdockercontainers mountPath
path: /var/lib/docker/containers
- name: persisting-cursor-storage
hostPath:
path: /var/lib/edgedelta
type: DirectoryOrCreate
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: debugfs
hostPath:
path: /sys/kernel/debug
- name: netns
hostPath:
path: /var/run/netns
- name: proc
hostPath:
path: /proc
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: edgedelta
subjects:
- kind: ServiceAccount
name: edgedelta
namespace: edgedelta
roleRef:
kind: ClusterRole
name: edgedelta
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: edgedelta
labels:
k8s-app: edgedelta-logging
rules:
- apiGroups: [""] # "" indicates the core API group
resources:
- namespaces
- pods
- events
- nodes
- nodes/metrics
- services
verbs:
- get
- watch
- list
- apiGroups: [""] # "" indicates the core API group
resources:
- events
verbs:
- create
- apiGroups: ["apps"]
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- watch
- list
- apiGroups: ["batch"]
resources:
- jobs
- cronjobs
verbs:
- watch
- list
- apiGroups: ["coordination.k8s.io"]
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups: ["metrics.k8s.io"]
resources:
- pods
- nodes
verbs:
- get
- list
- watch
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: edgedelta
namespace: edgedelta
labels:
k8s-app: edgedelta-logging
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: edgedelta-compactor
namespace: edgedelta
labels:
k8s-app: edgedelta-compactor
version: v1
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
matchLabels:
k8s-app: edgedelta-compactor
serviceName: ed-compactor-svc
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
k8s-app: edgedelta-compactor
version: v1
kubernetes.io/cluster-service: "true"
spec:
serviceAccountName: edgedelta
containers:
- name: edgedelta-compactor
image: gcr.io/edgedelta/agent:v1.28.0
ports:
- name: compactor
containerPort: 9199
env:
- name: ED_AGENT_MODE
value: compactor
- name: ED_COMPACTOR_PORT
value: "9199"
- name: ED_COMPACTOR_DATA_DIR
value: /var/edgedelta-compactor
- name: ED_HOST_OVERRIDE
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ED_API_KEY
valueFrom:
secretKeyRef:
name: ed-api-key
key: ed-api-key
- name: ED_TRACE_FILES
value: ""
resources:
limits:
cpu: 2000m
memory: 2000Mi
requests:
cpu: 1000m
memory: 1000Mi
imagePullPolicy: Always
volumeMounts:
- name: compactor-data
mountPath: /var/edgedelta-compactor
terminationGracePeriodSeconds: 60
volumes:
volumeClaimTemplates:
- metadata:
name: compactor-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 30Gi
---
kind: Service
apiVersion: v1
metadata:
name: ed-compactor-svc
namespace: edgedelta
spec:
selector:
k8s-app: edgedelta-compactor
ports:
- port: 9199
name: compactor-port