Skip to content

feat(alastor): ping krater's /healthz/edge every minute - #107

Open
Adambomb210 wants to merge 1 commit into
mainfrom
claude/krater-edge-ping
Open

Adambomb210 wants to merge 1 commit into
mainfrom
claude/krater-edge-ping

Conversation

@Adambomb210

Copy link
Copy Markdown
Collaborator

alastor now requests Krater's /healthz/edge every minute, so Krater can tell its runners going silent apart from its own network being down (patchworklabsorg/krater#83).

Runners report to Krater over Cloudflare → alastor → tailnet → weft. When that path breaks, every runner looks dead, and Krater used to stop boxes or fail jobs for it. With this ping, Krater holds those actions while the ping is stale, and alerts after 10 min ("alastor's ping stopped reaching Krater").

What changes in hosts/alastor/edge.nix:

  • New option patchwork.edge.kraterEdgePing (default true).
  • krater-edge-ping.service: a oneshot with DynamicUser. It runs curl -fsS -o /dev/null --max-time 20 against each URL, and the unit fails if any of them fails.
    • Staging is always on the list.
    • Production is added only while kraterProduction is on, like its routes.
  • krater-edge-ping.timer: OnCalendar = "minutely".
  • It goes through the public hostname on purpose (Cloudflare and Traefik, as a runner would). A request straight over the tailnet would miss half the path.

Deploy order:

  • Krater production should serve /healthz/edge before this reaches alastor. Until it does, the production request gets a 404 and the unit fails every minute. That's noise only: Krater never holds for a ping it has never seen.
  • Staging gets the endpoint when krater#83 merges.
  • alastor gets this only after jaspermayone/infra bumps its input.

After deploy:

  • Check systemctl status krater-edge-ping.timer krater-edge-ping on alastor.
  • curl -fsS https://krater-staging.patchworklabs.org/healthz/edge should return {"status":"ok"}.

Tested: nix build .#checks.x86_64-linux.krater-weft and the weave-alastor check pass. krater-weft has two new checks: the edge pings Krater every minute, and it pings production while production's routes are on. Formatted with the flake's nixfmt-tree. It hasn't run on alastor yet.

🤖 Generated with Claude Code

Krater stops a box, or fails a job and destroys its machine, when the
runner on it goes silent. Runners report over Cloudflare, Traefik on
alastor and the tailnet to weft, so when that path is down every runner
looks dead and none is.

A krater-edge-ping timer on alastor requests /healthz/edge on staging,
and on production while its routes are on, every minute over that same
path. Krater records it; when it stops arriving, Krater holds actions on
silent runners and alerts (patchworklabsorg/krater, claude/network-hold).
An HTTPS request rather than an ICMP ping, so it tests what runners use.

alastor builds from jaspermayone/infra: this goes live when that input is
bumped there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Adambomb210
Adambomb210 requested review from a team and jaspermayone November 15, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant