alertmanager-mqtt-bridge
by janip81
Bridges Prometheus Alertmanager to MQTT so Home Assistant sees homelab alerts (MQTT discovery sensors, push events, dead-man's-switch heartbeat)
About this chart
alertmanager-mqtt-bridge
Bridges Prometheus Alertmanager to MQTT so Home Assistant sees homelab alerts (MQTT discovery sensors, push events, dead-man's-switch heartbeat)
Homepage: https://github.com/janip81/helm-charts/tree/main/charts/alertmanager-mqtt-bridge
Maintainers
| Name | Url | |
|---|---|---|
| janip81 | [email protected] | https://github.com/janip81 |
Source Code
Overview
Bridges Prometheus Alertmanager to MQTT so Home Assistant shows homelab
alerts. It polls the Alertmanager API for the current state (retained
<prefix>/active, plus a <prefix>/heartbeat from the always-firing
Watchdog alert), and turns Alertmanager webhooks (POST /alertmanager)
into deduplicated firing/resolved events on <prefix>/event. Home Assistant
entities are created via MQTT discovery.
Point an Alertmanager webhook receiver at
http://<release service>.<namespace>.svc:8000/alertmanager.
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Affinity |
| alertmanagerUrl | string | "http://alertmanager-operated.prometheus.svc:9093" | Alertmanager base URL the bridge polls (GET /api/v2/alerts) |
| image.pullPolicy | string | "IfNotPresent" | Image pull policy |
| image.repository | string | "ghcr.io/janip81/alertmanager-mqtt-bridge" | Image repository |
| image.tag | string | "latest" | Image tag |
| imagePullSecrets | list | [] | Image pull secrets (the image is private) |
| mqtt.createSecret | bool | false | Create a Secret from user/password below instead (test/CI only) |
| mqtt.existingSecret | string | "" | Existing Secret with keys MQTT_USER and MQTT_PASSWORD (recommended) |
| mqtt.host | string | "mosquitto.mqtt.svc.cluster.local" | MQTT broker host |
| mqtt.password | string | "" | MQTT password when createSecret is true |
| mqtt.port | int | 1883 | MQTT broker port |
| mqtt.topicPrefix | string | "homelab/alerts" | Topic prefix (active, event, heartbeat, availability live under it) |
| mqtt.user | string | "" | MQTT user when createSecret is true |
| nodeSelector | object | {} | Node selector |
| podAnnotations | object | {} | Pod annotations |
| pollIntervalSeconds | int | 60 | Seconds between Alertmanager API polls (also the heartbeat cadence) |
| replicaCount | int | 1 | Replicas. Keep 1: two bridges would publish duplicate events. |
| resources | object | {"limits":{"cpu":"200m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"48Mi"}} | Resource requests/limits |
| service.port | int | 8000 | Service port (webhook POST /alertmanager, GET /metrics, GET /healthz) |
| serviceMonitor.enabled | bool | false | Create a Prometheus Operator ServiceMonitor |
| serviceMonitor.interval | string | "60s" | Scrape interval |
| serviceMonitor.labels | object | {} | Extra labels so your Prometheus selects it (e.g. release: ) |
| serviceMonitor.scrapeTimeout | string | "10s" | Scrape timeout |
| tolerations | list | [] | Tolerations |
Deploy alertmanager-mqtt-bridge with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has alertmanager-mqtt-bridge on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartalertmanager-mqtt-bridge is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply