Skip to content

Commit fd6d188

Browse files
authored
deploy monitoring using kustomize (CrunchyData#141)
* deploy monitoring using kustomize * make changes suggested by andrew to remove the script and env file * add security context to deployments and use the new exporter label * update readme about running monitoring in openshift
1 parent d27d2bd commit fd6d188

25 files changed

+9409
-0
lines changed

examples/monitoring/base/Readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To deploy monitoring,
2+
3+
1. verify the namespace is correct in kustomization.yaml
4+
2. If you are deploying in openshift, edit deploy*.yaml and comment out fsGroup line under securityContext
5+
3. kubectl apply -k .
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
apiVersion: v1
2+
data:
3+
alertmanager.yml: |
4+
###
5+
#
6+
# Copyright 2017-2021 Crunchy Data Solutions, Inc. All Rights Reserved.
7+
#
8+
###
9+
10+
# Based on upstream example file found here: https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml
11+
global:
12+
smtp_smarthost: 'localhost: 25'
13+
smtp_require_tls: false
14+
smtp_from: 'Alertmanager <[email protected]>'
15+
# smtp_smarthost: 'smtp.example.com:587'
16+
# smtp_from: 'Alertmanager <[email protected]>'
17+
# smtp_auth_username: '<username>'
18+
# smtp_auth_password: '<password>'
19+
20+
# templates:
21+
# - '/etc/alertmanager/template/*.tmpl'
22+
23+
inhibit_rules:
24+
# Apply inhibition of warning if the alertname for the same system and service is already critical
25+
- source_match:
26+
severity: 'critical'
27+
target_match:
28+
severity: 'warning'
29+
equal: ['alertname', 'job', 'service']
30+
31+
receivers:
32+
- name: 'default-receiver'
33+
email_configs:
34+
35+
send_resolved: true
36+
37+
## Examples of alternative alert receivers. See documentation for more info on how to configure these fully
38+
#- name: 'pagerduty-dba'
39+
# pagerduty_configs:
40+
# - service_key: <RANDOMKEYSTUFF>
41+
42+
#- name: 'pagerduty-sre'
43+
# pagerduty_configs:
44+
# - service_key: <RANDOMKEYSTUFF>
45+
46+
#- name: 'dba-team'
47+
# email_configs:
48+
49+
# send_resolved: true
50+
51+
#- name: 'sre-team'
52+
# email_configs:
53+
54+
# send_resolved: true
55+
56+
route:
57+
receiver: default-receiver
58+
group_by: [severity, service, job, alertname]
59+
group_wait: 30s
60+
group_interval: 5m
61+
repeat_interval: 24h
62+
63+
## Example routes to show how to route outgoing alerts based on the content of that alert
64+
# routes:
65+
# - match_re:
66+
# service: ^(postgresql|mysql|oracle)$
67+
# receiver: dba-team
68+
# # sub route to send critical dba alerts to pagerduty
69+
# routes:
70+
# - match:
71+
# severity: critical
72+
# receiver: pagerduty-dba
73+
#
74+
# - match:
75+
# service: system
76+
# receiver: sre-team
77+
# # sub route to send critical sre alerts to pagerduty
78+
# routes:
79+
# - match:
80+
# severity: critical
81+
# receiver: pagerduty-sre
82+
kind: ConfigMap
83+
metadata:
84+
labels:
85+
app.kubernetes.io/name: postgres-operator-monitoring
86+
vendor: crunchydata
87+
name: alertmanager-config
88+

0 commit comments

Comments
 (0)