-
Notifications
You must be signed in to change notification settings - Fork 88
/
kube-prometheus-stack.yaml
286 lines (265 loc) · 7.98 KB
/
kube-prometheus-stack.yaml
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
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: kube-prometheus-stack
namespace: monitoring
spec:
interval: 15m
chart:
spec:
chart: kube-prometheus-stack
version: 66.7.1
sourceRef:
kind: HelmRepository
name: prometheus-community-charts
namespace: flux-system
maxHistory: 3
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
crds:
enabled: true
cleanPrometheusOperatorObjectNames: true
defaultRules:
disabled:
HostHighCpuLoad: true
NodeSystemSaturation: true
alertmanager:
config:
global:
resolve_timeout: 5m
receivers:
- name: 'null'
- name: 'slack-notifications'
slack_configs:
- channel: '#notifications'
icon_url: https://avatars3.githubusercontent.com/u/3380462
username: 'Alertmanager'
send_resolved: true
title: |-
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ if ne .CommonAnnotations.summary ""}}{{ .CommonAnnotations.summary }} {{ else if ne .CommonAnnotations.message ""}}{{ .CommonAnnotations.message }} {{ else if ne .CommonAnnotations.description ""}}{{ .CommonAnnotations.description }} {{ else }}{{ .CommonLabels.alertname }}{{ end }}
text: >-
{{ range .Alerts -}}
*Alert:* {{ .Annotations.title }}{{ if .Labels.severity }} - `{{ .Labels.severity }}`{{ end }}
{{ if ne .Annotations.summary ""}}*Summary:* {{ .Annotations.summary }} {{ else if ne .Annotations.message ""}}*Message:* {{ .Annotations.message }} {{ else if ne .Annotations.description ""}}*Description:* {{ .Annotations.description }}{{ end }}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
{{ end }}
{{ end }}
route:
group_by: ["alertname", "job"]
group_wait: 45s
group_interval: 10m
repeat_interval: 12h
receiver: 'slack-notifications'
routes:
- receiver: "null" # quote
matchers:
- alertname =~ "Watchdog"
- receiver: "null" # quote
matchers:
- alertname =~ "InfoInhibitor"
- receiver: 'slack-notifications'
inhibit_rules:
- source_matchers:
- severity = "critical"
target_matchers:
- severity = "warning"
equal: ["alertname", "namespace"]
templates: ["*.tmpl"]
templateFiles:
pagerduty-custom.tmpl: |-
{{- define "pagerduty.custom.description" -}}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ if ne .CommonAnnotations.summary ""}}{{ .CommonAnnotations.summary }} {{ else if ne .CommonAnnotations.message ""}}{{ .CommonAnnotations.message }} {{ else if ne .CommonAnnotations.description ""}}{{ .CommonAnnotations.description }} {{ else }}{{ .CommonLabels.alertname }}{{ end }}{{- end -}}
ingress:
enabled: true
pathType: Prefix
ingressClassName: nginx-tailscale
hosts:
- prom-alert.eviljungle.com
tls:
- hosts:
- prom-alert.eviljungle.com
alertmanagerSpec:
replicas: 1
podAntiAffinity: hard
storage:
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
resources:
requests:
storage: 1Gi
grafana:
enabled: false
forceDeployDashboards: true
sidecar:
dashboards:
annotations:
grafana_folder: Kubernetes
kubelet:
enabled: true
serviceMonitor:
metricRelabelings:
- action: replace
sourceLabels: ["node"]
targetLabel: instance
kube-state-metrics:
metricLabelsAllowlist: ["persistentvolumeclaims=[*]"]
prometheus:
monitor:
enabled: true
relabelings:
- action: replace
regex: (.*)
replacement: $1
sourceLabels: ["__meta_kubernetes_pod_node_name"]
targetLabel: kubernetes_node
kubeApiServer:
enabled: true
kubeControllerManager:
enabled: false
endpoints:
- 10.2.0.30
service:
enabled: true
port: 10257
targetPort: 10257
serviceMonitor:
enabled: true
https: true
insecureSkipVerify: true
kubeScheduler:
enabled: false
endpoints:
- 10.2.0.30
service:
enabled: true
port: 10259
targetPort: 10259
serviceMonitor:
enabled: true
https: true
insecureSkipVerify: true
kubeProxy:
enabled: false
endpoints:
- 10.2.0.30
kubeEtcd:
enabled: false
endpoints:
- 10.2.0.30
service:
enabled: true
port: 2381
targetPort: 2381
prometheusOperator:
createCustomResource: true
prometheusConfigReloader:
resources:
limits:
cpu: 200m
admissionWebhooks:
enabled: false
prometheus:
ingress:
enabled: true
pathType: Prefix
ingressClassName: nginx-tailscale
hosts:
- prom-server.eviljungle.com
tls:
- hosts:
- prom-server.eviljungle.com
thanosService:
enabled: true
thanosServiceMonitor:
enabled: true
prometheusSpec:
replicas: 1
replicaExternalLabelName: "replica"
thanos:
image: quay.io/thanos/thanos:v0.37.1
version: v0.30.1
objectStorageConfig:
name: thanos-objstore-secret
key: objstore.yml
podAntiAffinity: hard
ruleSelectorNilUsesHelmValues: false
serviceMonitorSelectorNilUsesHelmValues: false
podMonitorSelectorNilUsesHelmValues: false
probeSelectorNilUsesHelmValues: false
retention: 2d
retentionSize: 6GB
enableAdminAPI: true
walCompression: true
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: rook-ceph-block
resources:
requests:
storage: 20Gi
resources:
requests:
memory: 2000Mi
cpu: 250m
limits:
memory: 5000Mi
additionalScrapeConfigs:
- job_name: 'ipmi'
metrics_path: '/metrics'
static_configs:
- targets:
- nas.home:9290
- job_name: 'node'
static_configs:
- targets:
- proxmox-b.home:9100
- proxmox-c.home:9100
- opnsense.home:9100
- nas.home:9100
- job_name: 'smartctl'
metrics_path: '/metrics'
static_configs:
- targets:
- nas.home:9633
- job_name: 'upsc-exporter'
metrics_path: '/metrics'
static_configs:
- targets:
- proxmox-b.home:8081
- proxmox-c.home:8081
- job_name: 'zfs'
metrics_path: '/metrics'
static_configs:
- targets:
- nas.home:9134
nodeExporter:
enabled: true
prometheus-node-exporter:
prometheus:
monitor:
enabled: true
# relabelings:
# - action: replace
# regex: (.*)
# replacement: $1
# sourceLabels:
# - __meta_kubernetes_pod_node_name
# targetLabel: instance
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
valuesFrom:
- kind: Secret
name: "kube-prometheus-stack-helm-values"
optional: false