Repository navigation
Description
Update 2026-11-26 (infra move): The rule, route, mount and Secret row move out of this item.
k8s/monitoring/ and the cluster Secret table are in dan-petty/homelab, and dan-petty/homelab#378 holds that work. This item keeps only the product part of the design below: the keyring credential healthchecks.ping_url and its loader test.
Problem or Motivation
All alerts go to Mattermost in the same cluster, and Alertmanager and the Mattermost files volume share one node. When the cluster, Prometheus, Alertmanager or Mattermost stops, no alert reaches a person. #1390 (closed) named an outside watchdog as a later item, but nobody filed it. This item is rank 8 of the cluster integration plan #4989.
Proposed Solution & Architectural Design
- Add a
Watchdogrule (vector(1)) that always fires. - Add an Alertmanager route with a short repeat interval to a
webhook_configthat reads its URL withurl_filefrom a mounted Secret, as the Mattermost URL does. - The receiver is an outside Healthchecks check (BSD-3-Clause). When the pings stop, Healthchecks tells the owner by its own channel.
- Add a promtool case and a SECURITY.md egress row. The monitoring NetworkPolicy already allows egress on TCP 443.
Owner decision
Choose hosted Healthchecks.io or a self-hosted Healthchecks outside the cluster. The recommended answer on #4989 is the hosted free tier. The owner makes the account, the check and its notify channel, and puts the ping URL in the keyring. devops k8s push-secrets writes it into a Secret. No secret goes into git. Agents write the rule, the route and the tests; the owner does the account and secret steps.
Target Subsystem
The managed credentials in src/devops_cli/config/env.py. The monitoring files are in dan-petty/homelab (#7163).
Existing Tool Considered
Healthchecks (BSD-3-Clause), hosted or self-hosted, with the standard Alertmanager webhook receiver. Nothing is built.
Acceptance Criteria
- A promtool case shows that
Watchdogalways fires. - The route sends
Watchdogto the heartbeat receiver only. - With the Secret in place, the Healthchecks check shows a ping at each repeat interval. When Alertmanager stops, the check goes down and the owner gets a notice.
Dependencies
Owner decision 1 on #4989: the account, the check and the ping URL in the keyring.
Source: #4989
Alternatives check of 2026-11-27: covers.
Tool: healthchecks/healthchecks (https://github.com/healthchecks/healthchecks), BSD-3-Clause, last activity 2026-11-23, maintained.
Reason: The repository page and searches show Healthchecks is an open heartbeat monitor: it accepts HTTP pings and alerts the owner when pings stop or run late, so it covers the outside heartbeat; the Watchdog rule, route and credential stay in the project.
Covers:
- Accepts HTTP pings from an Alertmanager webhook receiver
- Sends alerts when a ping does not arrive on time
- Period and grace time set the repeat interval and down threshold
- Hosted service keeps the check outside the cluster and its node
- 25+ notification integrations for the owner's channel
Lacks:
- No Watchdog rule or Alertmanager route; that config lives in homelab
- No keyring credential or Secret row for the ping URL
- No promtool case proving Watchdog always fires
- No egress row for the monitoring NetworkPolicy
Proposed design
Problem statement
All alerts go to Mattermost in the same cluster. An outage of the cluster, Prometheus, Alertmanager or Mattermost sends no alert to a person. An outside Healthchecks check reports a stopped alert path. This item declares the keyring credential healthchecks.ping_url in the managed credentials of this repository and proves the row shape. The environment tree of dan-petty/homelab holds the Watchdog rule, the Alertmanager route, the Secret mount and the cluster-secrets.toml row, and dan-petty/homelab#378 holds that work.
Acceptance criteria
Requirement: Heartbeat ping URL is a managed credential
The managed credentials SHALL declare healthchecks.ping_url as an optional keyring credential.
Scenario: The credential table holds the heartbeat key
- WHEN
uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k credentialruns. - THEN The command exits 0, and its case reports
healthchecks.ping_urlas an optional managed credential.
Requirement: The loader builds the heartbeat row
The cluster Secret loader MUST build row monitoring/alertmanager-healthchecks from a cluster-secrets.toml that holds it, under stack infra, with one optional url entry from healthchecks.ping_url.
Scenario: A cluster-secrets file holds the heartbeat row
- WHEN
uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k rowruns over acluster-secrets.tomlthat holds the heartbeat row. - THEN The command exits 0, and its case reports the row under stack
infrawith one optionalurlentry fromhealthchecks.ping_url.
Requirement: A missing ping URL skips the row
A push with no healthchecks.ping_url in the keyring MUST skip row monitoring/alertmanager-healthchecks.
Scenario: The keyring holds no ping URL
- WHEN
uv run pytest tests/k8s/test_cluster_secret_healthchecks.py -k skipruns with nohealthchecks.ping_urlin the keyring. - THEN The command exits 0, and its case reports the row as skipped and no Secret for it.
Existing Tool Considered
The alternatives check of 2026-11-21 in the issue body gives the verdict covers for healthchecks/healthchecks (BSD-3-Clause, maintained). That block lists what the tool covers and what it lacks. This item builds no monitor and no ping service. It declares keyring credential healthchecks.ping_url in src/devops_cli/config/env.py and proves the row shape, which fills the keyring part of the block's Lacks: list. The environment tree of dan-petty/homelab fills the rule, route and egress part, and dan-petty/homelab#378 holds it.
Key questions
- The alternatives check found that
https://github.com/healthchecks/healthcheckscovers this item. Adopt the tool, or keep the item and give the reason.: Adopt healthchecks/healthchecks. A person replied to the alternatives check with this decision. AGENTS.md rule 3 requires an open tool before the project builds code, and this item builds no monitor. (best practice) [sources: AGENTS.md]- Chosen: Adopt healthchecks/healthchecks. The person's reply adopts it, and the check of 2026-11-21 gives the verdict covers for a maintained BSD-3-Clause tool.
- Rejected: Keep the item with a reason. No reason remains. The tool covers the outside heartbeat, and the item adds no monitor.
- Which repository holds the Watchdog rule, the Alertmanager route and the Secret mount?:
dan-petty/homelab. Step 11 ofdocs/HOMELAB_REPO_SWITCH.mdswitched Argo CD to that repository.tests/gate/k8s_checks/environment_freeze.pytreatsk8s/monitoring/prometheus-values.yamlas an environment path, and thek8srow refuses an edit to that file in this repository. [sources: docs/HOMELAB_REPO_SWITCH.md, tests/gate/k8s_checks/environment_freeze.py, CONTEXT.md] - Which files hold the managed credentials and the cluster Secret push table now?:
src/devops_cli/config/env.pyholds the managed credentials.src/devops_cli/k8s/cluster_secrets.pyloads the push rows fromcluster-secrets.tomlin the environment tree, andtests/fixtures/cluster-secrets.tomlholds the rows that the tests read. [sources: src/devops_cli/config/env.py, src/devops_cli/k8s/cluster_secrets.py, tests/fixtures/cluster-secrets.toml, openspec/specs/cluster-secrets-loader/spec.md] - Where does the heartbeat row go, now that
src/holds nostack="infra"row?: The row goes intocluster-secrets.tomlof the environment tree indan-petty/homelab, with the rule, route and mount of dan-petty/homelab#378. This repository declares only the keyring credential and proves the row shape with a test. (best practice) [sources: src/devops_cli/k8s/cluster_secrets.py, tests/k8s/test_cluster_secret_source.py, openspec/specs/cluster-secrets-loader/spec.md]- Chosen: Row in the environment tree
cluster-secrets.toml. The loader readscluster-secrets.tomlfrom the environment tree, and the invariant test forbids aninfrarow insrc/. - Rejected: Row in
src/devops_cli/k8s/cluster_secrets.py. refactor(k8s): read the environment Secret rows from homelab #6685 moved the rows out, andtest_no_moved_stack_rows_remainfails the build on aninfrarow insrc/. - Rejected: Row in
tests/fixtures/cluster-secrets.tomlonly. The fixture is test data. It writes no Secret in the cluster.
- Chosen: Row in the environment tree
- How does the ping URL reach the Secret without a secret in git?: Use keyring credential
healthchecks.ping_urland rowmonitoring/alertmanager-healthcheckswith keyurlunder stackinfra.devops k8s push-secretswrites the Secret from the keyring. The owner puts the ping URL in the keyring. (best practice) [sources: SECURITY.md, src/devops_cli/config/env.py, src/devops_cli/k8s/cluster_secrets.py]- Chosen: Keyring credential and environment row. It follows the Mattermost hook and rule 1 of SECURITY.md, and it keeps the URL out of git.
- Rejected: Literal URL in the row file. It puts a secret in a committed file, against rule 1 of SECURITY.md.
- Rejected: The owner writes the Secret by hand. It is not repeatable, and the project writes each platform Secret with
devops k8s push-secrets.
- Is the heartbeat credential optional?: Yes. The managed credentials mark
healthchecks.ping_urlas optional, as the Mattermost hook is. A push with no value skips the row, so the owner can push before the account exists. (best practice) [sources: src/devops_cli/config/env.py, SECURITY.md]- Chosen: Optional credential. A push succeeds before the owner creates the Healthchecks check, and no other Secret depends on it.
- Rejected: Required credential. Every push fails for a person who has no Healthchecks account, and the owner's account step comes later.
- Which Healthchecks deployment does the heartbeat use, and who does the account step?: Hosted Healthchecks.io on the free tier. It adds no service or host for the project to run and keep. The owner creates the account, the check and the notify channel, and puts the ping URL in the keyring after the merge. Agents write no secret. (best practice) [sources: AGENTS.md]
- Chosen: Hosted Healthchecks.io free tier. It covers the outside heartbeat and adds no service or host for the owner to run and keep.
- Rejected: Self-hosted Healthchecks outside the cluster. It covers the same need but adds a service and a host for the owner to run and keep.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Moved to new items
dan-petty/homelab#374, dan-petty/homelab#378
Activity
dan-petty commentedon Nov 12, 2026
Both add Alertmanager routes, but dan-petty/devops-cli#1392 delivers alerts to Mattermost in-cluster while this item delivers a Watchdog ping to an outside Healthchecks endpoint.devops-cli-service commentedon Nov 15, 2026
Alternatives check: covers
Reason: Healthchecks is exactly the outside dead-man's-switch the issue describes: a check with a ping URL that an Alertmanager
webhook_configposts to at each repeat interval, and that notifies the owner through its own channels when the pings stop. It is available hosted (Healthchecks.io) or self-hosted outside the cluster under BSD-3-Clause, so the only remaining work is the project's own rule, route, test and egress row.Tool: healthchecks/healthchecks (https://github.com/healthchecks/healthchecks)
Covers:
Lacks:
Watchdogrecording rule or the Alertmanager route in k8s/monitoring/Tools considered:
Searches run:
Sources:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Owner question: Which Healthchecks deployment and owner setup should the heartbeat use? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 24, 2026
Adopt the tool: healthchecks/healthchecks. AGENTS.md rule 3 requires using an open tool before building.
devops-cli-service commentedon Nov 24, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
dan-petty commentedon Nov 25, 2026
Returning #4999 to New with evidence. The proposed design requires modifying
k8s/monitoring/prometheus-values.yamlto add thewatchdogrule group, thehealthchecksAlertmanager receiver, theWatchdogchild route, and thealertmanager-healthcheckssecret mount. Since step 11 ofdocs/HOMELAB_REPO_SWITCH.mdswitched Argo CD todan-petty/homelab,tests/gate/k8s_checks/environment_freeze.py:38-75(is_environment_path("k8s/monitoring/prometheus-values.yaml") == True) rejects edits to that file inuv run devops ci --check --only k8s. Re-refine #4999 or move the monitoring rule and Alertmanager route change todan-petty/homelabbefore implementing.devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
dan-petty commentedon Nov 25, 2026
Returning
#4999because its Proposed design (checked-at: sha=3dbcbd0bd22c50b8d0c19f57851efae77a640193) cannot be built as written onorigin/main:#6685): The design instructs adding themonitoring/alertmanager-healthchecksrow (stack="infra") tosrc/devops_cli/k8s/cluster_secrets.py, citingmonitoring/alertmanager-mattermostatsrc/devops_cli/k8s/cluster_secrets.py:567as the model. Onorigin/main,#6685removed allchat,gitea,infra, andbaserows fromsrc/devops_cli/k8s/cluster_secrets.py(line567is now insidedevops/crawl4ai), and movedmonitoring/alertmanager-mattermostinto data (tests/fixtures/cluster-secrets.toml:179-193) loaded fromk8s_dir / "cluster-secrets.toml"(src/devops_cli/k8s/cluster_secrets.py:472-494).stack="infra"insrc/:tests/k8s/test_cluster_secret_source.py::test_no_moved_stack_rows_remain(openspec/specs/cluster-secrets-loader/spec.md:22-27) assertsgit grep -n -E 'stack=(BASE_STACK|"(chat|gitea|infra)")' src/returns exit code1with empty output. Adding aninfrarow tosrc/devops_cli/k8s/cluster_secrets.pyfails this invariant check.cluster-secrets.tomlis outside this repository:dan-petty/homelabdoes not yet holdcluster-secrets.toml(repos/dan-petty/homelab/git/trees/main?recursive=1returned zerocluster-secretsfiles, andrepos/dan-petty/homelab/contents/k8s/cluster-secrets.tomlreturned HTTP404).Please re-scope
#4999(or move the Secret row to#7163/dan-petty/homelab) sodevops-clionly declares keyring credentialhealthchecks.ping_urlinsrc/devops_cli/config/env.py(or tests fixture support cleanly alongsidecluster-secrets.tomlschema/fixture expectations) without placingstack="infra"rows insrc/devops_cli/k8s/cluster_secrets.py.devops-cli-service commentedon Nov 26, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.