Niklas Ye bde5611b16 Let a TerdutServer turn on metrics from the alerts' Prometheus
terdut-server v0.49.0 graphs the metric behind each alert on the incident
page, but only queries hosts listed in TERDUT_PROMETHEUS_ALLOWED_HOSTS,
because the URL comes out of a webhook payload. An install this operator
creates had no way to set it short of spec.pod.extraEnv.

spec.prometheus takes allowedHosts, preroll and timeout and maps them to
TERDUT_PROMETHEUS_ALLOWED_HOSTS, _PREROLL and _TIMEOUT. Nothing is emitted
unless allowedHosts is non-empty, so existing TerdutServers get the same
Deployment as before, and unset durations are left to the server's defaults.
There is no CRD default for the host: which Prometheus to trust is the
deployer's call, not something this operator should assume.

The CRD in config/ is regenerated and the chart's copy carries the same
schema; the chart's optional TerdutServer passes the block through.

Claude-Session: https://claude.ai/code/session_016mBLURvJoMuUEr9cB2RpUN
2026-10-22 18:20:43 +02:00
2026-10-09 22:05:15 +02:00
2026-10-09 22:05:15 +02:00

Terdut operator

Exposes terdut-server's configuration as Kubernetes objects, so teams can self-service it over gitops. See DESIGN.md for the design (read its revision section first: it is the current shape of credentials and the CRD catalog), and examples/demo for a working install.

CRDs

TerdutServer

A terdut-server install: Deployment, Service, database wiring (a DSN, or a Zalando postgresClusterRef), and an operator key Secret it hands to the server so the operator can authenticate. allowedTeams consents to TerdutTeams in other namespaces.

TerdutTeam

One team on a server, possibly in another namespace (serverRef, gated by that server's allowedTeams). It carries the team's whole configuration:

  • displayName and OIDC group bindings
  • escalation — the escalation ladder
  • deadmanSwitches — dead man's switches, by name (switches not listed are removed)

TerdutAlertSource

An alert-ingest integration on a team (teamRef). The server shows the webhook key once; it is surfaced only through a generated Secret next to the object, never set explicitly.

Demo

examples/demo wires one of each together — two teams, each with an escalation ladder, a dead man's switch and an alert source — plus a script that fires synthetic Alertmanager webhooks at it, so you can watch incidents open, escalate and resolve without a real Alertmanager.

S
Description
No description provided
Readme 1.7 MiB
Languages
Go 89.6%
Makefile 8.5%
Go Template 1.1%
Dockerfile 0.8%