forked from kubernetes-sigs/headlamp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkubernetes-headlamp-monitoring.yaml
More file actions
197 lines (187 loc) · 3.9 KB
/
kubernetes-headlamp-monitoring.yaml
File metadata and controls
197 lines (187 loc) · 3.9 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
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
---
apiVersion: v1
kind: Service
metadata:
name: jaeger
namespace: kube-system
spec:
ports:
- port: 16686
name: ui
targetPort: 16686
- port: 4317
name: otlp-grpc
targetPort: 4317
- port: 4318
name: otlp-http
targetPort: 4318
selector:
app: jaeger
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
namespace: kube-system
spec:
selector:
matchLabels:
app: jaeger
template:
metadata:
labels:
app: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/all-in-one:latest
ports:
- containerPort: 16686
name: ui
- containerPort: 4317
name: otlp-grpc
- containerPort: 4318
name: otlp-http
env:
- name: COLLECTOR_OTLP_ENABLED
value: "true"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
namespace: kube-system
data:
otel-collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: ":4317"
http:
endpoint: ":4318"
processors:
batch:
timeout: 10s
exporters:
jaeger:
endpoint: "jaeger:14250"
tls:
insecure: true
prometheus:
endpoint: "0.0.0.0:8889"
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [jaeger]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [prometheus]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
namespace: kube-system
spec:
selector:
matchLabels:
app: otel-collector
template:
metadata:
labels:
app: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector:latest
ports:
- containerPort: 4317 # OTLP gRPC
- containerPort: 4318 # OTLP HTTP
- containerPort: 8889 # Prometheus exporter
volumeMounts:
- name: otel-collector-config
mountPath: /etc/otel-collector/config.yaml
subPath: otel-collector-config.yaml
volumes:
- name: otel-collector-config
configMap:
name: otel-collector-config
---
apiVersion: v1
kind: Service
metadata:
name: otel-collector
namespace: kube-system
spec:
ports:
- port: 4317
name: otlp-grpc
targetPort: 4317
- port: 4318
name: otlp-http
targetPort: 4318
- port: 8889
name: metrics
targetPort: 8889
selector:
app: otel-collector
---
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
namespace: kube-system
data:
prometheus.yml: |
scrape_configs:
- job_name: 'headlamp'
static_configs:
- targets: ['headlamp.kube-system.svc.cluster.local:4466'] # Changed to correct service endpoint
metrics_path: '/metrics' # Added explicit metrics path
- job_name: 'otel-collector'
static_configs:
- targets: ['otel-collector:8889']
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
namespace: kube-system
spec:
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
containers:
- name: prometheus
image: prom/prometheus:latest
ports:
- containerPort: 9090
volumeMounts:
- name: config
mountPath: /etc/prometheus/prometheus.yml
subPath: prometheus.yml
volumes:
- name: config
configMap:
name: prometheus-config
---
apiVersion: v1
kind: Service
metadata:
name: prometheus
namespace: kube-system
spec:
ports:
- port: 9090
targetPort: 9090
selector:
app: prometheus