prometheus-operator: Fix Alertmanager integration
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
parent
9a672d7ef3
commit
790ffa175b
@ -9,7 +9,16 @@ kubectl create -n prometheus-operator configmap snmp-exporter --from-file=snmp.y
|
|||||||
kubectl apply -n prometheus-operator -f application.yml -f node-exporter.yml -f blackbox-exporter.yml -f snmp-exporter.yml -f mikrotik-exporter.yml
|
kubectl apply -n prometheus-operator -f application.yml -f node-exporter.yml -f blackbox-exporter.yml -f snmp-exporter.yml -f mikrotik-exporter.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
# Mikrotik expoeter
|
|
||||||
|
# Slack
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl create -n prometheus-operator secret generic slack-secrets \
|
||||||
|
--from-literal=webhook-url=https://hooks.slack.com/services/...
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
# Mikrotik exporter
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl create -n prometheus-operator secret generic mikrotik-exporter \
|
kubectl create -n prometheus-operator secret generic mikrotik-exporter \
|
||||||
|
@ -1,4 +1,22 @@
|
|||||||
---
|
---
|
||||||
|
apiVersion: monitoring.coreos.com/v1alpha1
|
||||||
|
kind: AlertmanagerConfig
|
||||||
|
metadata:
|
||||||
|
name: alertmanager
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: alertmanager
|
||||||
|
spec:
|
||||||
|
route:
|
||||||
|
receiver: 'slack-notifications'
|
||||||
|
receivers:
|
||||||
|
- name: 'slack-notifications'
|
||||||
|
slackConfigs:
|
||||||
|
- channel: '#kube-prod'
|
||||||
|
sendResolved: true
|
||||||
|
apiURL:
|
||||||
|
name: slack-secrets
|
||||||
|
key: webhook-url
|
||||||
|
---
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
kind: PodMonitor
|
kind: PodMonitor
|
||||||
metadata:
|
metadata:
|
||||||
@ -15,6 +33,11 @@ kind: Alertmanager
|
|||||||
metadata:
|
metadata:
|
||||||
name: alertmanager
|
name: alertmanager
|
||||||
spec:
|
spec:
|
||||||
|
alertmanagerConfigSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: alertmanager
|
||||||
|
secrets:
|
||||||
|
- slack-secrets
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
dedicated: monitoring
|
dedicated: monitoring
|
||||||
tolerations:
|
tolerations:
|
||||||
@ -52,10 +75,8 @@ spec:
|
|||||||
alerting:
|
alerting:
|
||||||
alertmanagers:
|
alertmanagers:
|
||||||
- namespace: prometheus-operator
|
- namespace: prometheus-operator
|
||||||
name: alertmanager
|
name: alertmanager-operated
|
||||||
port: http
|
port: web
|
||||||
pathPrefix: "/"
|
|
||||||
apiVersion: v2
|
|
||||||
externalUrl: "http://prom.k-space.ee/"
|
externalUrl: "http://prom.k-space.ee/"
|
||||||
replicas: 2
|
replicas: 2
|
||||||
shards: 1
|
shards: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user