-
Notifications
You must be signed in to change notification settings - Fork 0
/
helm-template-df-extras.yaml
6140 lines (5899 loc) · 176 KB
/
helm-template-df-extras.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
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
# Source: kubeblocks/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubeblocks
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
---
# Source: kubeblocks/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: kubeblocks-addon-installer
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
---
# Source: kubeblocks/templates/cloud-provider-secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: kubeblocks-cloud-provider
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
stringData:
csi-s3: |
secret:
accessKey:
secretKey:
region:
cloudProvider:
storageClass:
bucket:
---
# Source: kubeblocks/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: kubeblocks-secret
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
type: Opaque
stringData:
dataProtectionEncryptionKey: kubeblocks-dp-aes256
---
# Source: kubeblocks/templates/applications/alertmanager-webhook-adaptor-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: alertmanager-webhook-adaptor-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kb-controller
operator: In
values:
- "true"
weight: 100
configFiles:
config.yaml: {}
configMapOverrideName: config
image:
registry: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com
---
# Source: kubeblocks/templates/applications/apecloud-otel-collector-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: apecloud-otel-collector-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
enabled: false
image:
registry: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com
---
# Source: kubeblocks/templates/applications/aws-loadbalancer-controller-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-load-balancer-controller-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kb-controller
operator: In
values:
- "true"
weight: 100
clusterName: ""
enabled: false
replicaCount: 1
serviceAccount:
create: true
name: kubeblocks-service-account-aws-load-balancer-controller
tolerations:
- effect: NoSchedule
key: kb-controller
operator: Equal
value: "true"
---
# Source: kubeblocks/templates/applications/csi-hostpath-driver-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: csi-hostpath-driver-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
enabled: false
storageClass:
create: true
default: true
---
# Source: kubeblocks/templates/applications/external-dns-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: external-dns-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
domain: kubeblocks.io
enabled: false
tolerations:
- effect: NoSchedule
key: kb-controller
operator: Equal
value: "true"
---
# Source: kubeblocks/templates/applications/grafana-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
adminPassword: kubeblocks
adminUser: admin
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kb-controller
operator: In
values:
- "true"
weight: 100
defaultDashboardsTimezone: null
enabled: false
grafana.ini:
auth.anonymous:
enabled: true
hide_version: true
auth.basic:
enabled: false
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/grafana
tag: 9.2.4
ingress:
annotations: {}
enabled: false
extraPaths: []
hosts:
- chart-example.local
labels: {}
path: /
pathType: Prefix
tls: []
rbac:
pspEnabled: false
replicas: 1
resources: {}
service:
annotations: {}
appProtocol: ""
enabled: true
labels: {}
port: 80
portName: service
targetPort: 3000
type: ClusterIP
sidecar:
dashboards:
enabled: true
label: grafana_dashboard
labelValue: "1"
resource: configmap
searchNamespace: ALL
datasources:
defaultDatasourceEnabled: true
enabled: true
initDatasources: true
label: grafana_datasource
labelValue: "1"
resource: configmap
searchNamespace: ALL
skipReload: false
uid: prometheus
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/k8s-sidecar
tag: 1.19.2
testFramework:
enabled: false
tolerations:
- effect: NoSchedule
key: kb-controller
operator: Equal
value: "true"
---
# Source: kubeblocks/templates/applications/loki-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: loki-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
enabled: false
loki:
auth_enabled: false
commonConfig:
replication_factor: 1
compactor:
compaction_interval: 10m
delete_request_cancel_period: 2h
retention_delete_delay: 2h
retention_delete_worker_count: 150
retention_enabled: true
shared_store: filesystem
working_directory: /var/loki/retention
limits_config:
max_query_lookback: 72h
retention_period: 72h
podSecurityContext:
runAsNonRoot: false
runAsUser: 0
storage:
type: filesystem
monitoring:
dashboards:
enabled: false
lokiCanary:
enabled: false
rules:
enabled: false
selfMonitoring:
enabled: false
grafanaAgent:
installOperator: false
serviceMonitor:
enabled: false
singleBinary:
replicas: 1
test:
enabled: false
---
# Source: kubeblocks/templates/applications/prometheus-values.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-chart-kubeblocks-values
labels:
helm.sh/chart: kubeblocks-0.8.1
app.kubernetes.io/name: kubeblocks
app.kubernetes.io/instance: kubeblocks
app.kubernetes.io/version: "0.8.1"
app.kubernetes.io/managed-by: Helm
data:
values-kubeblocks-override.yaml: |-
# set prometheus.alertmanager.image.repository
# set prometheus.nodeExporter.image.repository
# set prometheus configmapReload prometheus and alertmanager image.repository
# set prometheus.server.image.repository
alertmanager:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kb-controller
operator: In
values:
- "true"
weight: 100
configMapOverrideName: alertmanager-config
containerSecurityContext:
allowPrivilegeEscalation: false
enabled: true
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/alertmanager
tag: v0.24.0
ingress:
annotations: {}
enabled: false
extraLabels: {}
extraPaths: []
hosts: []
path: /
pathType: Prefix
tls: []
persistentVolume:
enabled: false
size: 1Gi
replicaCount: 1
resources: {}
securityContext:
fsGroup: 65534
runAsGroup: 65534
runAsNonRoot: false
runAsUser: 0
service:
annotations: {}
clusterIP: ""
externalIPs: []
labels: {}
loadBalancerIP: ""
loadBalancerSourceRanges: []
servicePort: 80
sessionAffinity: None
type: ClusterIP
statefulSet:
enabled: true
headless:
enableMeshPeer: true
tolerations:
- effect: NoSchedule
key: kb-controller
operator: Equal
value: "true"
alertmanagerFiles:
alertmanager.yml:
global: {}
receivers:
- name: default-receiver
route:
group_interval: 30s
group_wait: 5s
receiver: default-receiver
repeat_interval: 10m
configmapReload:
alertmanager:
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/configmap-reload
tag: v0.5.0
prometheus:
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/configmap-reload
tag: v0.5.0
enabled: false
kubeStateMetrics:
enabled: false
nodeExporter:
enabled: false
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/node-exporter
tag: v1.3.1
pushgateway:
enabled: false
ruleFiles:
kafka_alert_rules.yaml: |-
group:
- name: KafkaExporter
rules:
- alert: KafkaTopicsReplicas
expr: 'sum(kafka_topic_partition_in_sync_replica) by (topic) < 3'
for: 0m
labels:
severity: critical
annotations:
summary: 'Kafka topics replicas (instance {{ $labels.app_kubernetes_io_instance }})'
description: 'Kafka topic in-sync partition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}'
- alert: KafkaConsumersGroup
expr: 'sum(kafka_consumergroup_lag) by (consumergroup) > 50'
for: 1m
labels:
severity: critical
annotations:
summary: 'Kafka consumers group (instance {{ $labels.app_kubernetes_io_instance }})'
description: 'Kafka consumers group\n VALUE = {{ $value }}\n LABELS = {{ $labels }}'
- alert: KafkaBrokerDown
expr: 'kafka_brokers < 3'
for: 0m
labels:
severity: critical
annotations:
Summary: 'Kafka broker *{{ $labels.app_kubernetes_io_instance }}* alert status'
description: 'One of the Kafka broker *{{ $labels.app_kubernetes_io_instance }}* is down.'
kubelet_alert_rules.yml: |
groups:
- name: KubeletSummary
rules:
- alert: ContainerCpuUsageWarning
expr: 'rate(container_cpu_time_seconds_total[2m]) / container_cpu_limit * 100 > 70'
for: 2m
labels:
severity: warning
annotations:
summary: 'Container CPU usage is high (> 70%)'
description: 'Container CPU usage is {{ $value | printf "%.2f" }} percent. (pod: {{ $labels.k8s_pod_name }}, container: {{ $labels.k8s_container_name }})'
- alert: ContainerCpuUsageCritical
expr: 'rate(container_cpu_time_seconds_total[2m]) / container_cpu_limit * 100 > 90'
for: 1m
labels:
severity: critical
annotations:
summary: 'Container CPU usage is very high (> 90%)'
description: 'Container CPU usage is {{ $value | printf "%.2f" }} percent. (pod: {{ $labels.k8s_pod_name }}, container: {{ $labels.k8s_container_name }})'
- alert: ContainerMemoryUsage
expr: 'container_memory_working_set_bytes / container_memory_limit_bytes * 100 > 90'
for: 2m
labels:
severity: warning
annotations:
summary: 'Container Memory usage is high (> 90%)'
description: 'Container Memory usage is {{ $value | printf "%.2f" }} percent. (pod: {{ $labels.k8s_pod_name }}, container: {{ $labels.k8s_container_name }})'
- alert: ContainerMemoryUsagePredict
expr: 'predict_linear(container_memory_working_set_bytes[15m], 30*60) - container_memory_limit_bytes > 0'
for: 5m
labels:
severity: critical
annotations:
summary: 'Container Memory predict usage may exceed the limit 30 minutes later'
description: 'Container Memory predict usage may exceed the limit 30 minutes later, the predict value is {{ $value | humanize1024 }}. (pod: {{ $labels.k8s_pod_name }}, container: {{ $labels.k8s_container_name }})'
- alert: ContainerVolumeUsage
expr: '(k8s_volume_capacity_bytes - k8s_volume_available_bytes) / k8s_volume_capacity_bytes * 100 > 90'
for: 2m
labels:
severity: warning
annotations:
summary: 'Volume usage is high (> 90%)'
description: 'Volume usage is {{ $value | printf "%.2f" }} percent. (pod: {{ $labels.k8s_pod_name }}, volume: {{ $labels.k8s_volume_name }})'
mongodb_alert_rules.yml: "groups:\n - name: MongodbExporter\n rules:\n -
alert: MongodbDown\n expr: 'max_over_time(mongodb_up[1m]) == 0'\n for:
0m\n labels:\n severity: critical\n annotations:\n summary:
'MongoDB is Down'\n description: 'MongoDB instance is down\\n VALUE
= {{ $value }}\\n LABELS = {{ $labels }}'\n\n - alert: MongodbRestarted\n
\ expr: 'mongodb_instance_uptime_seconds < 60'\n for: 0m\n labels:\n
\ severity: info\n annotations:\n summary: 'Mongodb has
just been restarted (< 60s)'\n description: 'Mongodb has just been restarted
{{ $value | printf \"%.1f\" }} seconds ago\\n LABELS = {{ $labels }}'\n\n -
alert: MongodbReplicaMemberUnhealthy\n expr: 'max_over_time(mongodb_rs_members_health[1m])
== 0'\n for: 0m\n labels:\n severity: critical\n annotations:\n
\ summary: 'Mongodb replica member is unhealthy'\n description:
'MongoDB replica member is not healthy\\n VALUE = {{ $value }}\\n LABELS = {{
$labels }}'\n\n - alert: MongodbReplicationLag\n expr: '(mongodb_rs_members_optimeDate{member_state=\"PRIMARY\"}
- on (pod) group_right mongodb_rs_members_optimeDate{member_state=\"SECONDARY\"})
/ 1000 > 10'\n for: 0m\n labels:\n severity: critical\n
\ annotations:\n summary: 'MongoDB replication lag (> 10s)'\n description:
'Mongodb replication lag is more than 10s\\n VALUE = {{ $value }}\\n LABELS
= {{ $labels }}'\n\n - alert: MongodbReplicationHeadroom\n expr: 'sum(avg(mongodb_mongod_replset_oplog_head_timestamp
- mongodb_mongod_replset_oplog_tail_timestamp)) - sum(avg(mongodb_rs_members_optimeDate{member_state=\"PRIMARY\"}
- on (pod) group_right mongodb_rs_members_optimeDate{member_state=\"SECONDARY\"}))
<= 0'\n for: 0m\n labels:\n severity: critical\n annotations:\n
\ summary: 'MongoDB replication headroom (< 0)'\n description:
'MongoDB replication headroom is <= 0\\n VALUE = {{ $value }}\\n LABELS = {{
$labels }}'\n\n - alert: MongodbNumberCursorsOpen\n expr: 'mongodb_ss_metrics_cursor_open{csr_type=\"total\"}
> 10 * 1000'\n for: 2m\n labels:\n severity: warning\n
\ annotations:\n summary: 'MongoDB opened cursors num (> 10k)'\n
\ description: 'Too many cursors opened by MongoDB for clients (> 10k)\\n
\ VALUE = {{ $value }}\\n LABELS = {{ $labels }}'\n\n - alert: MongodbCursorsTimeouts\n
\ expr: 'increase(mongodb_ss_metrics_cursor_timedOut[1m]) > 100'\n for:
2m\n labels:\n severity: warning\n annotations:\n summary:
'MongoDB cursors timeouts (>100/minute)' \n description: 'Too many cursors
are timing out (> 100/minute)\\n VALUE = {{ $value }}\\n LABELS = {{ $labels
}}'\n\n - alert: MongodbTooManyConnections\n expr: 'avg by(pod) (rate(mongodb_ss_connections{conn_type=\"current\"}[1m]))
/ avg by(pod) (sum (mongodb_ss_connections) by(pod)) * 100 > 80'\n for:
2m\n labels:\n severity: warning\n annotations:\n summary:
'MongoDB too many connections (> 80%)'\n description: 'Too many connections
(> 80%)\\n VALUE = {{ $value }}\\n LABELS = {{ $labels }}'\n\n - alert:
MongodbVirtualMemoryUsage\n expr: '(sum(mongodb_ss_mem_virtual) BY (pod)
/ sum(mongodb_ss_mem_resident) BY (pod)) > 100'\n for: 2m\n labels:\n
\ severity: warning\n annotations:\n summary: MongoDB
virtual memory usage high\n description: \"High memory usage: the quotient
of (mem_virtual / mem_resident) is more than 100\\n VALUE = {{ $value }}\\n LABELS
= {{ $labels }}\""
mysql_alert_rules.yml: |
groups:
- name: MysqldExporter
rules:
- alert: MysqlDown
expr: 'max_over_time(mysql_up[1m]) == 0'
for: 0m
labels:
severity: critical
annotations:
summary: 'MySQL is down'
description: 'MySQL is down. (instance: {{ $labels.pod }})'
- alert: MysqlRestarted
expr: 'mysql_global_status_uptime < 60'
for: 0m
labels:
severity: info
annotations:
summary: 'MySQL has just been restarted (< 60s)'
description: 'MySQL has just been restarted {{ $value | printf "%.1f" }} seconds ago. (instance: {{ $labels.pod }})'
- alert: MysqlTooManyConnections
expr: 'sum(max_over_time(mysql_global_status_threads_connected[1m]) / mysql_global_variables_max_connections) BY (namespace,app_kubernetes_io_instance,pod) * 100 > 80'
for: 2m
labels:
severity: warning
annotations:
summary: 'MySQL has too many connections (> 80%)'
description: '{{ $value | printf "%.2f" }} percent of MySQL connections are in use. (instance: {{ $labels.pod }})'
- alert: MysqlConnectionErrors
expr: 'sum(increase(mysql_global_status_connection_errors_total[1m])) BY (namespace,app_kubernetes_io_instance,pod) > 0'
for: 2m
labels:
severity: warning
annotations:
summary: 'MySQL connection errors'
description: 'MySQL has connection errors and the value is {{ $value | printf "%.2f" }}. (instance: {{ $labels.pod }})'
- alert: MysqlHighThreadsRunning
expr: 'sum(max_over_time(mysql_global_status_threads_running[1m]) / mysql_global_variables_max_connections) BY (namespace,app_kubernetes_io_instance,pod) * 100 > 60'
for: 2m
labels:
severity: warning
annotations:
summary: 'MySQL high threads running (> 60%)'
description: '{{ $value | printf "%.2f" }} percent of MySQL connections are in running state. (instance: {{ $labels.pod }})'
- alert: MysqlSlowQueries
expr: 'sum(increase(mysql_global_status_slow_queries[1m])) BY (namespace,app_kubernetes_io_instance,pod) > 0'
for: 2m
labels:
severity: info
annotations:
summary: 'MySQL slow queries'
description: 'MySQL server has {{ $value | printf "%.2f" }} slow query. (instance: {{ $labels.pod }})'
- alert: MysqlInnodbLogWaits
expr: 'sum(rate(mysql_global_status_innodb_log_waits[5m])) BY (namespace,app_kubernetes_io_instance,pod) > 10'
for: 2m
labels:
severity: warning
annotations:
summary: 'MySQL InnoDB log waits (> 10)'
description: 'MySQL innodb log writes stalling and the value is {{ $value | printf "%.2f" }}. (instance: {{ $labels.pod }})'
- alert: MysqlInnodbBufferPoolHits
expr: 'sum(rate(mysql_global_status_innodb_buffer_pool_reads[5m]) / rate(mysql_global_status_innodb_buffer_pool_read_requests[5m])) BY (namespace,app_kubernetes_io_instance,pod) * 100 > 5'
for: 2m
labels:
severity: warning
annotations:
summary: 'MySQL InnoDB high read requests rate hitting disk (> 5%)'
description: 'High number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from disk. The value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
postgresql_alert_rules.yml: |
groups:
- name: PostgreSQLExporter
rules:
- alert: PostgreSQLDown
expr: 'max_over_time(pg_up[1m]) == 0'
for: 0m
labels:
severity: critical
annotations:
summary: 'PostgreSQL is down'
description: 'PostgreSQL is down. (instance: {{ $labels.pod }})'
- alert: PostgreSQLRestarted
expr: 'time() - pg_postmaster_start_time_seconds < 60'
for: 0m
labels:
severity: info
annotations:
summary: 'PostgreSQL has just been restarted (< 60s)'
description: 'PostgreSQL has just been restarted {{ $value | printf "%.1f" }} seconds ago. (instance: {{ $labels.pod }})'
- alert: PostgreSQLExporterError
expr: 'pg_exporter_last_scrape_error > 0'
for: 0m
labels:
severity: warning
annotations:
summary: 'PostgreSQL exporter scrape error'
description: 'PostgreSQL exporter has {{ $value | printf "%.2f" }} scrape errors. A query may be buggy in query.yaml. (instance: {{ $labels.pod }})'
- alert: PostgreSQLTooManySlowQueries
expr: |
max by(namespace,app_kubernetes_io_instance,pod,datname) (
max_over_time(pg_stat_activity_max_tx_duration{datname!~"template.*"}[2m])
) > 60
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL database has high number of slow queries'
description: 'PostgreSQL database has slow queries and the value is {{ $value | printf "%.2f" }}. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLTooManyConnections
expr: |
sum by (namespace,app_kubernetes_io_instance,pod) (pg_stat_activity_count{datname!~"template.*"})
> on(namespace,app_kubernetes_io_instance,pod)
(pg_settings_max_connections - pg_settings_superuser_reserved_connections) * 0.8
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL too many connections (> 80%)'
description: 'PostgreSQL has too many connections and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: PostgreSQLDeadLocks
expr: 'increase(pg_stat_database_deadlocks_total{datname!~"template.*", datname!=""}[2m]) > 5'
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL database has dead locks (> 5)'
description: 'PostgreSQL database has {{ $value | printf "%.2f"}} dead locks. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLHighRollbackRate
expr: |
rate(pg_stat_database_xact_rollback_total{datname!~"template.*", datname!=""}[2m])
/
rate(pg_stat_database_xact_commit_total{datname!~"template.*", datname!=""}[2m])
> 0.1
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL database has high rollback rate (> 10%)'
description: 'Ratio of transactions being aborted compared to committed is {{ $value | printf "%.2f"}} percent. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLTooManyLocksAcquired
expr: |
sum by (namespace,app_kubernetes_io_instance,pod) (pg_locks_count)
/ on(namespace,app_kubernetes_io_instance,pod)
(pg_settings_max_locks_per_transaction * pg_settings_max_connections)
> 0.2
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL has too many locks acquired (> 20%)'
description: 'Too many locks acquired on the database and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: PostgreSQLCacheHitRatio
expr: |
avg by (namespace,app_kubernetes_io_instance,pod,datname) (
rate(pg_stat_database_blks_hit_total{datname!~"template.*", datname!=""}[2m])
/
(
rate(
pg_stat_database_blks_hit_total{datname!~"template.*", datname!=""}[2m]
)
+
rate(
pg_stat_database_blks_read_total{datname!~"template.*", datname!=""}[2m]
)
)
) < 0.9
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL database has low cache hit rate (< 90%)'
description: 'Low cache hit rate and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLMaxWriteBufferReached
expr: 'rate(pg_stat_bgwriter_maxwritten_clean_total[2m]) > 0'
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL write buffers reached max'
description: 'PostgreSQL background writer stops for max and the value is {{ $value | printf "%.2f" }}. (instance: {{ $labels.pod }})'
- alert: PostgreSQLHighWALFilesArchiveErrorRate
expr: |
rate(pg_stat_archiver_failed_count_total[2m])
/ (
rate(pg_stat_archiver_archived_count_total[2m]) + rate(pg_stat_archiver_failed_count_total[2m])
) > 0.1
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL has high error rate in WAL files archiver(> 10%)'
description: 'PostgreSQL high error rate in WAL files archiver and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: PostgreSQLTableNotAutoVacuumed
expr: |
(pg_stat_user_tables_last_autovacuum > 0)
and
(time() - pg_stat_user_tables_last_autovacuum)
> 24 * 60 * 60 * 10
for: 0m
labels:
severity: warning
annotations:
summary: 'PostgreSQL table in database has not been auto vacuumed for 10 days'
description: 'Table {{ $labels.relname }} in database has not been auto vacuumed for 10 days. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLTableNotAutoAnalyzed
expr: |
(pg_stat_user_tables_last_autoanalyze > 0)
and
(time() - pg_stat_user_tables_last_autoanalyze)
> 24 * 60 * 60 * 10
for: 0m
labels:
severity: warning
annotations:
summary: 'PostgreSQL table in database has not been auto analyzed for 10 days'
description: 'Table {{ $labels.relname }} in database has not been auto analyzed for 10 days. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
- alert: PostgreSQLTableTooManyDeadTuples
expr: |
(pg_stat_user_tables_n_dead_tup > 10000)
/
(pg_stat_user_tables_n_live_tup + pg_stat_user_tables_n_dead_tup)
>= 0.1
for: 2m
labels:
severity: warning
annotations:
summary: 'PostgreSQL table in database has too many dead tuples (> 10%)'
description: 'Table {{ $labels.relname }} in database dead tuples is too large and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }}, database: {{ $labels.datname }})'
redis_alert_rules.yml: |
groups:
- name: RedisExporter
rules:
- alert: RedisDown
expr: 'redis_up == 0'
for: 5m
labels:
severity: critical
annotations:
summary: 'Redis is down'
description: 'Redis is down. (instance: {{ $labels.pod }})'
- alert: RedisCPUHigh
expr: '(rate(redis_cpu_sys_seconds_total[1m]) + rate(redis_cpu_user_seconds_total[1m])) * 100 > 80'
for: 2m
labels:
severity: warning
annotations:
summary: 'Out of CPU (> 80%)'
description: 'Redis is running out of CPU and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: RedisMemoryHigh
expr: '(redis_memory_max_bytes == 0 or redis_memory_used_bytes * 100 / redis_memory_max_bytes) > 90'
for: 5m
labels:
severity: warning
annotations:
summary: 'Out of memory (> 90%)'
description: 'Redis is running out of memory and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: RedisTooManyConnections
expr: 'redis_connected_clients * 100 / redis_config_maxclients > 80'
for: 1m
labels:
severity: warning
annotations:
summary: 'Redis has too many connections (> 80%)'
description: 'Redis has too many connections and the value is {{ $value | printf "%.2f" }} percent. (instance: {{ $labels.pod }})'
- alert: RedisRejectedConnections
expr: 'increase(redis_rejected_connections_total[1m]) > 0'
for: 5m
labels:
severity: error
annotations:
summary: 'Redis has rejected connections'
description: '{{ $value | printf "%.2f" }} connections to Redis has been rejected. (instance: {{ $labels.pod }})'
- alert: RedisKeyEviction
expr: 'increase(redis_evicted_keys_total[5m]) > 0'
for: 1s
labels:
severity: error
annotations:
summary: 'Redis has evicted keys'
description: 'Redis has evicted keys in the last 5 minutes and the value is {{ $value | printf "%.2f" }}. (instance: {{ $labels.pod }})'
- alert: RedisMissingMaster
expr: 'count by (app_kubernetes_io_instance) (redis_instance_info{role="master"}) < 1'
for: 30s
labels:
severity: critical
annotations:
summary: 'Redis missing master'
description: 'Redis cluster has no node marked as master.'
- alert: RedisDisconnectedSlaves
expr: 'count without (instance, job) (redis_connected_slaves) - sum without (instance, job) (redis_connected_slaves) - 1 > 1'
for: 0m
labels:
severity: critical
annotations:
summary: 'Redis disconnected slaves'
description: 'Redis not replicating for all slaves. Consider reviewing the redis replication status. (instance: {{ $labels.pod }})'
- alert: RedisReplicationBroken
expr: 'delta(redis_connected_slaves[1m]) < 0'
for: 0m
labels:
severity: critical
annotations:
summary: 'Redis replication broken'
description: 'Redis instance lost a slave. (instance: {{ $labels.pod }})'
server:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kb-controller
operator: In
values:
- "true"
weight: 100
containerSecurityContext:
allowPrivilegeEscalation: false
enabled: true
extraArgs:
enable-feature: memory-snapshot-on-shutdown
log.level: info
storage.tsdb.min-block-duration: 30m
storage.tsdb.retention.size: 10GB
extraFlags:
- web.enable-lifecycle
- web.enable-remote-write-receiver
global:
evaluation_interval: 15s
scrape_interval: 15s
scrape_timeout: 10s
image:
repository: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/prometheus
tag: v2.44.0
ingress:
annotations: {}
enabled: false
extraLabels: {}
extraPaths: []
hosts: []
path: /
pathType: Prefix
tls: []
persistentVolume:
enabled: false
size: 20Gi
remoteWrite: []
replicaCount: 1
resources: {}
retention: 2d
routePrefix: /
securityContext:
fsGroup: 65534
runAsGroup: 65534
runAsNonRoot: false
runAsUser: 0
service:
annotations: {}
clusterIP: ""
enabled: true
externalIPs: []
gRPC:
enabled: false
servicePort: 10901
labels: {}
loadBalancerIP: ""
loadBalancerSourceRanges: []
servicePort: 80
sessionAffinity: None
statefulsetReplica:
enabled: false
replica: 0
type: ClusterIP
statefulSet:
enabled: true
tolerations:
- effect: NoSchedule
key: kb-controller
operator: Equal
value: "true"
serverFiles:
prometheus.yml:
rule_files:
- /etc/config/recording_rules.yml
- /etc/config/alerting_rules.yml
- /etc/config/kubelet_alert_rules.yml
- /etc/config/mysql_alert_rules.yml
- /etc/config/postgresql_alert_rules.yml
- /etc/config/redis_alert_rules.yml
- /etc/config/kafka_alert_rules.yml
- /etc/config/mongodb_alert_rules.yml
scrape_configs:
- job_name: prometheus
static_configs:
- targets:
- localhost:9090
- honor_labels: true
job_name: kubeblocks-service
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
regex: kubeblocks
source_labels:
- __meta_kubernetes_service_label_app_kubernetes_io_managed_by
- action: drop
regex: agamotto
source_labels:
- __meta_kubernetes_service_label_monitor_kubeblocks_io_managed_by
- action: keep
regex: true
source_labels:
- __meta_kubernetes_service_annotation_monitor_kubeblocks_io_scrape
- action: replace
regex: (https?)
source_labels:
- __meta_kubernetes_service_annotation_monitor_kubeblocks_io_scheme
target_label: __scheme__
- action: replace
regex: (.+)
source_labels:
- __meta_kubernetes_service_annotation_monitor_kubeblocks_io_path
target_label: __metrics_path__
- action: replace
regex: (.+?)(?::\d+)?;(\d+)
replacement: $1:$2
source_labels:
- __address__
- __meta_kubernetes_service_annotation_monitor_kubeblocks_io_port
target_label: __address__
- action: labelmap