alertmanager-mqtt-bridge

by janip81

Helm chartv0.1.0App 0.1.0Verified publisher

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

NameEmailUrl
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

KeyTypeDefaultDescription
affinityobject{}Affinity
alertmanagerUrlstring"http://alertmanager-operated.prometheus.svc:9093"Alertmanager base URL the bridge polls (GET /api/v2/alerts)
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/janip81/alertmanager-mqtt-bridge"Image repository
image.tagstring"latest"Image tag
imagePullSecretslist[]Image pull secrets (the image is private)
mqtt.createSecretboolfalseCreate a Secret from user/password below instead (test/CI only)
mqtt.existingSecretstring""Existing Secret with keys MQTT_USER and MQTT_PASSWORD (recommended)
mqtt.hoststring"mosquitto.mqtt.svc.cluster.local"MQTT broker host
mqtt.passwordstring""MQTT password when createSecret is true
mqtt.portint1883MQTT broker port
mqtt.topicPrefixstring"homelab/alerts"Topic prefix (active, event, heartbeat, availability live under it)
mqtt.userstring""MQTT user when createSecret is true
nodeSelectorobject{}Node selector
podAnnotationsobject{}Pod annotations
pollIntervalSecondsint60Seconds between Alertmanager API polls (also the heartbeat cadence)
replicaCountint1Replicas. Keep 1: two bridges would publish duplicate events.
resourcesobject{"limits":{"cpu":"200m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"48Mi"}}Resource requests/limits
service.portint8000Service port (webhook POST /alertmanager, GET /metrics, GET /healthz)
serviceMonitor.enabledboolfalseCreate a Prometheus Operator ServiceMonitor
serviceMonitor.intervalstring"60s"Scrape interval
serviceMonitor.labelsobject{}Extra labels so your Prometheus selects it (e.g. release: )
serviceMonitor.scrapeTimeoutstring"10s"Scrape timeout
tolerationslist[]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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartalertmanager-mqtt-bridge is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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