kube/monitoring/mikrotik-exporter.yaml

120 lines
3.0 KiB
YAML
Raw Normal View History

2022-09-11 13:24:35 +00:00
---
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: mikrotik
spec:
2024-09-04 19:33:15 +00:00
basicAuth:
username:
name: mikrotik-exporter
key: username
password:
name: mikrotik-exporter
key: password
2022-09-11 13:24:35 +00:00
prober:
url: mikrotik-exporter
2024-09-04 19:33:15 +00:00
module: full
2022-09-11 13:24:35 +00:00
targets:
staticConfig:
static:
2024-09-04 19:33:15 +00:00
- 172.23.0.1
- 172.23.0.100
- 100.102.1.111
- 100.102.1.112
- 100.102.1.114
- 100.102.1.115
- 100.102.1.121
- 100.102.1.131
- 100.102.1.141
- 100.102.1.151
2022-09-11 13:24:35 +00:00
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: mikrotik
spec:
groups:
- name: mikrotik
rules:
2024-09-09 19:19:46 +00:00
- alert: MikrotikBondRedundancyLost
expr: mikrotik_bond_port_active == 0
for: 2m
2022-09-11 13:24:35 +00:00
labels:
severity: error
annotations:
summary: Switch uplink high availability lost
2024-09-09 19:19:46 +00:00
description: One of the two bonds has inactive member interface
2022-09-11 13:24:35 +00:00
- alert: MikrotikLinkRateDegraded
2024-09-09 19:19:46 +00:00
expr: mikrotik_interface_link_rate_bps{interface=~"sfp-sfpplus.*"} < 10000000000
for: 2m
2022-09-11 13:24:35 +00:00
labels:
severity: error
annotations:
2024-09-09 19:19:46 +00:00
summary: SFP+ link degraded
description: One of the SFP+ (10G) links is running at lower speed
- alert: MikrotikLinkRateDegraded
expr: mikrotik_interface_link_rate_bps{interface=~"qsfpplus.*"} < 40000000000
for: 2m
labels:
severity: error
annotations:
summary: QSFP+ link degraded
description: One of the QSFP+ (40G) links is running at lower speed
2022-09-11 13:24:35 +00:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mikrotik-exporter
spec:
revisionHistoryLimit: 0
replicas: 2
selector:
matchLabels:
app: mikrotik-exporter
template:
metadata:
labels:
app: mikrotik-exporter
spec:
containers:
- name: mikrotik-exporter
image: mirror.gcr.io/codemowers/mikrotik-exporter:latest@sha256:3148c06a90b9836598695645b85c8514fa67ac9e7c644b3daf4853577fce0efb
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: mikrotik-exporter
2022-09-11 13:24:35 +00:00
nodeSelector:
node-role.kubernetes.io/control-plane: ''
2022-09-11 13:24:35 +00:00
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Equal
value: ''
effect: NoSchedule
2022-09-11 13:24:35 +00:00
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- mikrotik-exporter
topologyKey: "kubernetes.io/hostname"
2022-09-11 13:24:35 +00:00
---
kind: Service
apiVersion: v1
metadata:
name: mikrotik-exporter
spec:
type: ClusterIP
ports:
- name: http
port: 80
protocol: TCP
targetPort: 3001
selector:
app: mikrotik-exporter