This repository has been archived by the owner on Dec 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathalertmanager.yaml
157 lines (150 loc) · 4.4 KB
/
alertmanager.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
apiVersion: v1
kind: Template
metadata:
name: alertmanager
annotations:
"openshift.io/display-name": Prometheus Alert Manager
description: |
A monitoring solution for an OpenShift cluster - collect and gather metrics from nodes, services, and the infrastructure. This component provides the Alert Manager.
iconClass: icon-cogs
tags: "monitoring,prometheus,alertmanager,time-series"
parameters:
- description: The location of the prometheus image
name: IMAGE_ALERTMANAGER
value: wkulhanek/alertmanager:latest
- name: VOLUME_CAPACITY
displayName: Volume Capacity
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 4Gi
required: true
- name: WEBHOOK_URL
displayName: Webhook URL
description: URL for the Webhook to send alerts.
required: true
objects:
- apiVersion: v1
kind: Route
metadata:
name: alertmanager
spec:
to:
name: alertmanager
- apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/scheme: http
labels:
name: alertmanager
name: alertmanager
spec:
ports:
- name: alertmanager
port: 9093
protocol: TCP
targetPort: 9093
selector:
app: alertmanager
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: alertmanager
name: alertmanager
spec:
replicas: 1
selector:
app: alertmanager
deploymentconfig: alertmanager
template:
metadata:
labels:
app: alertmanager
deploymentconfig: alertmanager
name: alertmanager
spec:
containers:
- name: alertmanager
args:
- --config.file=/etc/alertmanager/config.yml
- --storage.path=/alertmanager
image: ${IMAGE_ALERTMANAGER}
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /#/status
port: 9093
scheme: HTTP
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /#/status
port: 9093
scheme: HTTP
initialDelaySeconds: 2
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
volumeMounts:
- mountPath: /etc/alertmanager
name: config-volume
- mountPath: /alertmanager
name: data-volume
restartPolicy: Always
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: alertmanager-data-pvc
- configMap:
name: alertmanager
name: config-volume
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: alertmanager-data-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: "${VOLUME_CAPACITY}"
- apiVersion: v1
kind: ConfigMap
metadata:
name: alertmanager
data:
config.yml: |
global:
# The root route on which each incoming alert enters.
route:
# The root route must not have any matchers as it is the entry point for
# all alerts. It needs to have a receiver configured so alerts that do not
# match any of the sub-routes are sent to someone.
receiver: 'webhook'
# The labels by which incoming alerts are grouped together. For example,
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would
# be batched into a single group.
group_by: ['alertname', 'cluster']
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 30s
# When the first notification was sent, wait 'group_interval' to send a batch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 3h
receivers:
- name: 'webhook'
webhook_configs:
- send_resolved: true
url: '${WEBHOOK_URL}'