-
Notifications
You must be signed in to change notification settings - Fork 1
/
monitoring-kubernetes.yml
338 lines (326 loc) · 7.64 KB
/
monitoring-kubernetes.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
#######################################################################
# THIS FILE IS AUTOMATICALLY GENERATED DURING CI/CD.
# ANY LOCAL CHANGES YOU MAKE SHOULD NOT BE COMMITTED TO SOURCE CONTROL.
#######################################################################
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: default_view
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
name: default
---
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
labels:
system: quarkus-super-heroes
app: prometheus
role: monitoring
data:
prometheus.yml: |2
global:
scrape_interval: 10s
external_labels:
system: quarkus-super-heroes
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: k8s-discovery
kubernetes_sd_configs:
- role: pod
namespaces:
own_namespace: true
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
labels:
system: quarkus-super-heroes
app: otel-collector
role: monitoring
data:
otel-collector-config.yml: |2
receivers:
otlp:
protocols:
grpc:
exporters:
jaeger:
endpoint: jaeger:14250
tls:
insecure: true
processors:
batch:
extensions:
health_check:
service:
extensions:
- health_check
pipelines:
traces:
receivers:
- otlp
processors:
- batch
exporters:
- jaeger
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
labels:
system: quarkus-super-heroes
name: prometheus
app: prometheus
role: monitoring
app.kubernetes.io/part-of: monitoring
app.openshift.io/runtime: prometheus
annotations:
app.openshift.io/connects-to: ui-super-heroes,rest-fights,rest-villains,rest-heroes,event-statistics,apicurio
spec:
replicas: 1
selector:
matchLabels:
name: prometheus
template:
metadata:
labels:
system: quarkus-super-heroes
name: prometheus
app: prometheus
role: monitoring
spec:
containers:
- image: quay.io/prometheus/prometheus:v2.43.0
name: prometheus
ports:
- containerPort: 9090
volumeMounts:
- name: prometheus-config
mountPath: /etc/prometheus
- name: prometheus-data
mountPath: /prometheus
resources:
limits:
memory: 128Mi
requests:
memory: 32Mi
volumes:
- name: prometheus-data
emptyDir: { }
- name: prometheus-config
configMap:
name: prometheus-config
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
labels:
system: quarkus-super-heroes
name: jaeger
app: jaeger
role: monitoring
app.kubernetes.io/part-of: monitoring
app.openshift.io/runtime: jaeger
spec:
replicas: 1
selector:
matchLabels:
name: jaeger
template:
metadata:
labels:
system: quarkus-super-heroes
name: jaeger
app: jaeger
role: monitoring
spec:
containers:
- image: jaegertracing/all-in-one:1
name: jaeger
ports:
- containerPort: 16686
- containerPort: 14268
- containerPort: 14250
resources:
limits:
memory: 128Mi
requests:
memory: 32Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
labels:
system: quarkus-super-heroes
name: otel-collector
app: otel-collector
role: monitoring
app.kubernetes.io/part-of: monitoring
app.openshift.io/runtime: opentelemetry
annotations:
app.openshift.io/connects-to: jaeger
spec:
replicas: 1
selector:
matchLabels:
name: otel-collector
template:
metadata:
labels:
system: quarkus-super-heroes
name: otel-collector
app: otel-collector
role: monitoring
spec:
containers:
- image: otel/opentelemetry-collector:0.75.0
name: otel-collector
args:
- "--config=/conf/otel-collector-config.yml"
ports:
- name: health-check
containerPort: 13133
- name: otlp-receiver
containerPort: 4317
volumeMounts:
- name: otel-collector-config
mountPath: /conf
resources:
limits:
memory: 128Mi
requests:
memory: 32Mi
livenessProbe:
timeoutSeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
httpGet:
port: health-check
scheme: HTTP
path: /
readinessProbe:
timeoutSeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
httpGet:
port: health-check
scheme: HTTP
path: /
startupProbe:
timeoutSeconds: 10
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
httpGet:
port: health-check
scheme: HTTP
path: /
volumes:
- name: otel-collector-config
configMap:
name: otel-collector-config
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
labels:
name: prometheus
system: quarkus-super-heroes
app: prometheus
role: monitoring
spec:
ports:
- port: 9090
name: scrape
protocol: TCP
targetPort: 9090
selector:
name: prometheus
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: jaeger
labels:
name: jaeger
system: quarkus-super-heroes
app: jaeger
role: monitoring
spec:
ports:
- port: 16686
name: ui
protocol: TCP
targetPort: 16686
- port: 14268
name: thrift
protocol: TCP
targetPort: 14268
- port: 14250
name: grpc
protocol: TCP
targetPort: 14250
selector:
name: jaeger
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
name: otel-collector
labels:
name: otel-collector
system: quarkus-super-heroes
app: otel-collector
role: monitoring
spec:
ports:
- port: 13133
name: healthcheck
protocol: TCP
targetPort: 13133
- port: 4317
name: grpc
protocol: TCP
targetPort: 4317
selector:
name: otel-collector
type: ClusterIP