...
1apiVersion: v1
2kind: Service
3metadata:
4 annotations:
5 prometheus.io/scrape: 'true'
6 prometheus.io/path: '/metrics'
7 name: alertmanager
8 labels:
9 app: alertmanager
10spec:
11 ports:
12 - name: main
13 port: 9093
14 protocol: TCP
15 targetPort: 9093
16 selector:
17 app: alertmanager
18---
19apiVersion: apps/v1
20kind: Deployment
21metadata:
22 name: alertmanager
23spec:
24 selector:
25 matchLabels:
26 app: alertmanager
27 replicas: 1
28 template:
29 metadata:
30 name: alertmanager
31 labels:
32 app: alertmanager
33 spec:
34 containers:
35 - image: prom/alertmanager:v0.15.2
36 args:
37 - '--config.file=/etc/alertmanager/alerts.yaml'
38 - '--storage.path=/alertmanager'
39 - '--web.external-url=https://alertmanager.example.com'
40 ports:
41 - name: alertmanager
42 containerPort: 9093
43 name: alertmanager
44 volumeMounts:
45 - name: config-volume
46 mountPath: /etc/alertmanager
47 - name: alertmanager
48 mountPath: /alertmanager
49 volumes:
50 - name: config-volume
51 configMap:
52 name: alertmanager
53 - name: alertmanager
54 emptyDir: {}
View as plain text