Skip to content

0020 - The Operational Agent on the Mac Mini, in Its Own Container Environment, Outside hetzner-mgmt

Status

Proposed 2026-10-21 in Taskbase task #1450 (epic "Ops agent runner", #66). It started from the owner's decision of 2026-10-21 that every upgrade, core included, is fully automatic (#1334): "if we must have an operating agent on the mac mini that can do disaster recovery then so be it."

Revised 2026-10-22 for the owner's new design. There is one operational agent, and it runs on the Mac mini in its own container environment. There is no in-cluster ops agent: #1332 is closed as superseded. The agent is triggered by its own health checks, by alerts, by Renovate tasks and by attention items.

Constrained the same day by the owner: for now the agent does not touch Terraform, Hetzner or Talos. Its only break-glass access is a certificate-based admin kubeconfig, Kubernetes and Talos upgrades stay manual, and failures below Kubernetes go to the owner (§7).

Amended 2026-10-23 by ADR 0022 (task #1487): the operator and the Gitea Actions runners share one Lima VM k3s (6 cores, 9 GiB, 50 GiB) instead of the VMs ops and ci, because CI runs rootless and unprivileged there. §3 is superseded, and §2's VM, size and LaunchDaemon change; the account agent-ops stays and now owns that one VM; the namespace stays ops-agent. The rest of this record holds. Where a name below says ops for the instance, read k3s: template cluster/mac-mini/lima/k3s.yaml, LaunchDaemon io.lima-vm.daemon.k3s, install.

Amended 2026-10-24 (Taskbase task #1457, platform task #1462): trigger d, attention items, is built in Taskbase. The Triage up the reporting line section has its loop guard and limits. ADR 0018 now names it among the operator's triggers as well.

Amended 2026-10-24 (Taskbase task #1463, platform task #1522): open question 1 and §6 are answered. A runner files its DR run report as an incident task with POST /api/runners/{id}/incidents, outside a claimed run. The decision does not change.

Amended 2026-11-03 (platform task #2378, agent-runner task #2393): the Taskbase probe in §5 also makes an authenticated read that queries the database. On 2026-11-03 Taskbase's database pool deadlocked for about 46 minutes; /api/health answered 200 without touching the database, so the watchdog started no session. A 401 or 403 within the timeout counts as up, so a revoked token cannot start sessions. The decision does not change.

Amended 2026-11-03 (platform task #2415, owner decision on #2397): the operator also reads the Mac mini's own ci namespace: pods, their logs and events, Jobs, Deployments, ReplicaSets and the ScaledJob, with no exec, no Secrets and no writes. It reads through the ServiceAccount ops-agent/ops-agent-ci-reader, as context mac-mini of the break-glass kubeconfig (install). The ci pods still cannot reach the API server. The decision does not change.

Amended 2026-11-15 (platform task #3236, owner decisions on #3215 and #3216, after the outage of 2026-11-14 in #3211): §8 gains rule 7. A DR session may make one fix to an application's data alone, for a CNPG database that crash-loops on one query: one row by its primary key, only after its on-demand CNPG Backup has completed, and only after the old values and the exact statement are in the dr issue (runbook). The mac-mini context of ops-agent/ops-agent-ci-reader also reads pods, pods/log and events in the ops-agent namespace, with no exec, no Secrets and no writes (install), so a session reads a finishing run's pod directly. The decision does not change.

The record is accepted when its pull request is merged. It changes nothing live. The build and the owner's install are planned in Implementation tasks.

Date

2026-10-22

Context

ADR 0018 turns alerts and failed deploys into Taskbase incidents, and an operator runner with the label role=ops claims them. With dashboard approval gone for every class (#1334), that agent also upgrades Cilium, Flux, MetalLB and hcloud-csi. Talos and Kubernetes upgrades stay manual, done by the owner: Renovate leaves them out of scope (Renovate), and they are never routed to operator. A bad change to one of these can take down the cluster network or the Kubernetes API. An agent that runs in the cluster would lose everything it needs at once:

An in-cluster agent needs Runs on
its own pod, scheduled by the API server hetzner-mgmt
Taskbase, its queue hetzner-mgmt (tasks-prod)
Gitea, its Git and the Flux source hetzner-mgmt (gitea)
Keycloak, its login and the OIDC kubeconfigs hetzner-mgmt (keycloak)
Harbor, its image hetzner-mgmt (harbor)

So the operational agent runs outside the cluster. It reaches the cluster without Keycloak, and it starts without Taskbase when the cluster is down. The owner wants it in its own container environment on the Mac mini, kept apart from the always-on mac-mini runner. The owner suggested a self-hosted minikube.

What exists today (read on 2026-10-22: Skatzi/platform main 49f2104, Skatzi/agent-runner main da2e244 = v0.5.21)

  • The Mac mini is a Mac16,10 with an Apple M4: 10 cores, 16 GiB of memory, macOS 15.5.
  • Its data volume is 87 % full, with 25 GiB free (df -h /System/Volumes/Data).
  • It runs the mac-mini Taskbase runner as the macOS account skatziopenclaw (agent-runner after the 2026-10 rebuild, see the note in §1).
  • It runs the Gitea release runner as agent-release-build, through the LaunchDaemon com.skatzi.agent-release-build (macOS release runner).
  • It has Homebrew, kubectl and helm.
  • It has no container runtime: no docker, colima, limactl, minikube or kind.
  • The agent-runner image is amd64 only. The release workflow builds it with kaniko --custom-platform linux/amd64 (.gitea/workflows/release.yml, job image).
  • The agent-runner Helm chart (deploy/helm/agent-runner, #1331) already has what the operator needs:
  • mode: deployment | cronjob;
  • serviceAccount, and rbac.clusterRoleBinding;
  • tools init containers for kubectl, flux and helm;
  • Claude with the claude_token secret key;
  • extraEnv, extraVolumes and extraConfig.

It has no cilium or gh, and no watchdog. - agent-runner run --once always registers with Taskbase and claims from it. There is no local-task mode. - Flux fallback source. Gitea push-mirrors Skatzi/platform to the private repository github.com/DunkRing/bootstrap-cluster. The guarded switch-git-source.py moves Flux between the two (Flux: switching to the fallback and back, #1168).

Facts checked for this record

Fact Source
The Kubernetes API answers on 78.47.74.196:6443. Its serving certificate is for control-plane-1, with the SANs 10.0.0.10 and 78.47.74.196. The topology table in Talos OS Upgrade is out of date (#1454). openssl s_client -connect 78.47.74.196:6443 from the Mac mini, 2026-10-21
The Hetzner firewall talos-firewall opens 6443 (and the Talos API on 50000, which the operator does not use) only to var.admin_ip. The Mac mini reaches 6443 today. A VM on the Mac mini leaves through the Mac's NAT, so it has the same public IP. terraform/environments/hetzner-mgmt-cluster/1-bootstrap/main.tf, hcloud_firewall.talos_firewall; nc -z from the Mac mini, 2026-10-21
/readyz refuses anonymous requests (401), so the probe uses the break-glass client certificate. Taskbase /api/health and Gitea /api/healthz answer 200 without a login. curl from the Mac mini, 2026-10-21
The admin kubeconfig comes from talosctl kubeconfig, with context admin@mgmt-cluster, so making it needs the talosconfig. Each download is a client certificate valid for a year. 1-bootstrap/main.tf (talosctl gen config mgmt-cluster …); Sidero docs, PKI and certificate lifetimes
The Terraform state of hetzner-mgmt is local, and it is not on the Mac mini. 1-bootstrap has no backend, and 2-components uses backend "local". Spotlight finds neither terraform.tfstate nor talosconfig on the Mac mini, and terraform is not installed there. This does not decide the operator's scope; the owner rule in §7 does. 1-bootstrap/main.tf, 2-components/main.tf; mdfind on the Mac mini, 2026-10-21
Lima ≥ 2.2 starts an instance at boot, without a user session. limactl autostart enable --condition=boot --user <user> <instance> installs /Library/LaunchDaemons/io.lima-vm.daemon.<instance>.plist, which runs limactl start <instance> --foreground as that user, with KeepAlive on a failed exit. limactl stop unloads that daemon. Lima recovers stale state after a power loss by itself. Lima ships a k3s template. Licence Apache-2.0. Homebrew has 2.2.1. Lima docs, Automatic Startup; pkg/autostart/launchd/io.lima-vm.daemon.INSTANCE.plist; templates/k3s.yaml
colima (MIT, 0.10.3) wraps Lima. It can run k3s (--kubernetes) and has start --foreground. Its documented autostart is brew services start colima, which is a LaunchAgent that needs a login. colima FAQ "Does Colima support autostart?"; colima embedded/defaults/colima.yaml
minikube (1.39.0) prefers the vfkit driver on macOS, which needs macOS 14 or later. minikube start creates or starts the VM and returns, with no foreground or boot-service mode. Its docker driver needs a separate Docker engine. minikube docs Drivers and vfkit
OrbStack needs a paid licence for business and commercial use. Without the GUI it is started with orb start, and it has no boot service. OrbStack FAQ, Command line & CI usage
k3s runs the control plane in one process. --secrets-encryption encrypts Secrets at rest, and --disable turns off bundled parts such as traefik and servicelb. k3s server CLI

Options considered

Where the operational agent runs

  • A. A container environment on the Mac mini, under its own macOS account (chosen). It is outside the cluster, on hardware the owner already has. It reuses the agent-runner chart and the operator persona.
  • B. In hetzner-mgmt (#1332, superseded). It cannot repair the cluster that hosts it.
  • C. A small VM at another provider. It costs money, adds another machine to look after, and still needs the admin_ip firewall entry. It is deferred, in case the Mac mini proves unreliable.
  • D. Give the existing mac-mini runner the role=ops label. The owner rules it out. It would also hand cluster-admin to every task that runner works.

Which container environment

Boot without login arm64 Resource caps Kubernetes (chart, CronJob, Job) Licence Verdict
Lima + k3s template yes: limactl autostart --condition=boot, a supervised LaunchDaemon from Lima itself yes (vz) VM cpus, memory, disk k3s, one process Apache-2.0 chosen
colima + k3s only with our own LaunchDaemon around colima start --foreground; its documented autostart needs a login yes VM flags k3s MIT a good second; an extra layer over Lima without a supervised boot mode
minikube (vfkit) no service mode; minikube start returns, so launchd cannot supervise it yes VM flags kubeadm control plane, several components Apache-2.0 rejected: no supervised boot, heavier control plane
kind needs a Docker engine first (Docker Desktop needs a login and a licence for business use, or colima) yes engine's VM Kubernetes in a container, inside the VM Apache-2.0 rejected: two layers for one node
OrbStack k8s no boot service; GUI app or orb start yes app settings built in paid for business use rejected: licence, no boot service
plain Docker (in a VM) as the engine's VM yes VM, plus docker run limits none — rejected: no CronJob, Job or RBAC, so the chart cannot be reused and lock, schedule and restart are hand-built

The owner suggested minikube. It runs well on this Mac, but it fails the first criterion: nothing in minikube keeps the VM running after a reboot or a crash. Lima does this itself, and minikube's other benefits (add-ons, many drivers) do not matter for a single-purpose node.

How DR mode is started

  • A. A watchdog CronJob in the environment, which starts a DR session Job (chosen).
  • B. Taskbase pushes the incident. Taskbase is one of the things that may be down.
  • C. A person starts the session. That contradicts "fully automatic", but it stays possible through the same Job.

How the owner is notified when Mattermost is down

  • A. A GitHub issue on DunkRing/bootstrap-cluster (chosen). It needs nothing in the cluster. It is the same account as the Git fallback, and the owner gets an e-mail and an app notification.
  • B. E-mail over SMTP. There is no SMTP account or credential today.
  • C. Mattermost. It runs on hetzner-mgmt.

Decision

flowchart LR
  subgraph mm["Mac mini (macOS, account agent-ops)"]
    ld["launchd: io.lima-vm.daemon.k3s (boot, keep-alive)"]
    ec["launchd: com.skatzi.ops-env-check (every 5 min)"]
    subgraph vm["Lima VM k3s (shared with the ci namespace, ADR 0022)"]
      fl["Flux (cluster/mac-mini)"]
      run["ops-agent runner (Deployment)"]
      wd["watchdog (CronJob, every minute)"]
      dr["DR session (Job)"]
      sec["Secrets: credentials, break-glass"]
    end
  end
  subgraph hm["hetzner-mgmt"]
    api["kube-apiserver :6443"]
    tb["Taskbase"]
    gitea["Gitea"]
  end
  gh["GitHub bootstrap-cluster: mirror and issues"]

  ld --> vm
  ec -- "checks VM, k3s, watchdog ticks" --> vm
  ec -- "environment broken" --> gh
  fl -- "pulls cluster/mac-mini" --> gitea
  run -- "claims role=ops tasks" --> tb
  wd -- "readyz with client cert, Flux state" --> api
  wd -- "health" --> tb
  wd -- "healthz" --> gitea
  wd -- "starts" --> dr
  dr -- "kubectl, flux, helm" --> api
  run -- "kubectl, flux, helm" --> api
  dr -- "pushes fixes, opens dr issues" --> gh

1. One operational agent: ops-agent, on the Mac mini

Setting Value
Taskbase runner, Keycloak user, Gitea user ops-agent (the identities planned in #1329). Organization scope Skatzi (2), Dupondforge (5) and Emmalia (8).
Agents Claude only. The large tier is claude-opus-5-5, which is also default_model. It has its own Claude setup token, not shared with any other runner.
Slots 1 task slot, session_slots: 0
Labels dedicated_label: role=ops, and labels: [role=ops, dr=mac-mini]. A task that must run on this machine, such as the drill, requires dr=mac-mini.
Persona operator
Cluster access Only the break-glass kubeconfig (§4). It has no OIDC, no ServiceAccount in hetzner-mgmt, no talosconfig, and no Terraform or Hetzner credentials (§7). On the Mac mini it reads the ci namespace only (context mac-mini, #2415).

The mac-mini runner keeps its scope, labels, account and login unchanged, as the owner requires.

Note, 2026-10-22: with the reinstall of the Mac mini, the mac-mini runner moves from the owner's account skatziopenclaw to a dedicated standard account agent-runner. Its scope, labels and Taskbase runner stay the same. See the Mac mini rebuild.

Triggers. In normal mode the agent claims role=ops tasks from Taskbase. In DR mode the watchdog starts it without Taskbase.

Trigger Route Task
a. Its own health checks The watchdog starts a local DR session (§6), without Taskbase #1451
b. Monitoring alerts Alertmanager → Taskbase incident task → operator, role=ops (ADR 0018) #1337, #1338
c. Renovate tasks of class breaking, stateful or core Taskbase routing → operator, role=ops. There is no dashboard approval for any class. #1333, #1334
d. Attention items A Taskbase triage task per item → operator, role=ops (Triage up the reporting line) #1457

2. The environment: a Lima VM ops with k3s, owned by the macOS account agent-ops

Amended by ADR 0022. The VM is the shared instance k3s from cluster/mac-mini/lima/k3s.yaml, 6 cores, 9 GiB and 50 GiB, started by io.lima-vm.daemon.k3s, with the CI runners in the namespace ci next to ops-agent. The operator keeps its own account agent-ops, which owns that VM: whoever owns a Lima instance can be root in it, and the VM holds ops-agent-break-glass, so the account must not be agent-runner, whose agents run with full access. Flux installs the source, kustomize and helm controllers there.

  • macOS account agent-ops. A standard, non-admin account. It owns LIMA_HOME (~agent-ops/.lima), so the VM disk, the k3s kubeconfig and the Secrets inside them belong to this account, not to agent-runner (the mac-mini runner; skatziopenclaw before the 2026-10 rebuild) or to agent-release-build.
  • Lima instance ops, created from a template kept in the platform repository at cluster/mac-mini/lima/ops.yaml. It is based on Lima's k3s template, with these settings:
  • vmType: vz, arm64;
  • cpus: 2, memory: 4GiB, disk: 20GiB;
  • k3s pinned with INSTALL_K3S_VERSION, because Lima's template installs the latest by default;
  • k3s args --secrets-encryption, --disable=traefik and --disable=servicelb;
  • no host mounts.
  • Boot. The LaunchDaemon io.lima-vm.daemon.ops starts the VM at boot without a login, and it restarts Lima's host agent when it exits with a failure.
  • Note of 2026-10-22 (#1460): the plist is installed by hand from cluster/mac-mini/host/io.lima-vm.daemon.ops.plist, not by limactl autostart enable. Lima 2.2.1's autostart enable --condition=boot runs sudo launchctl itself and refuses to run as root, so it cannot install the daemon for the standard account agent-ops; its plist also lacks KeepAlive and LIMA_HOME, which the hand-installed one sets (Lima v2.2.1 cmd/limactl/autostart_darwin.go; ADR 0021).
  • Configuration is GitOps. Flux runs in the k3s cluster, with only the source, kustomize and helm controllers.
  • It pulls ./cluster/mac-mini from Gitea Skatzi/platform over SSH, with a read-only deploy key generated on the Mac mini.
  • When Gitea is down, Flux keeps the last applied state, which is what DR needs.
  • Renovate updates the chart and image versions there, as it does for hetzner-mgmt.
  • What runs in the cluster, in the namespace ops-agent:
Object What
HelmRelease ops-agent The agent-runner chart in mode: deployment, Claude on and Codex off, tools on. Its ServiceAccount has no ClusterRoleBinding: it needs nothing in the local cluster.
Watchdog CronJob agent-runner watchdog, every minute, concurrencyPolicy: Forbid. Its ServiceAccount has a Role in ops-agent only: create and list Jobs, read pods and logs, and scale the ops-agent Deployment.
DR session Job Created by the watchdog from the same image, running the local one-shot mode (§6), with backoffLimit: 0 and activeDeadlineSeconds 3 h
PVC ops-agent-dr k3s local-path, mounted at /dr in all three: the watchdog state, the drill arm, the pending run reports
Secret ops-agent-credentials password, gitea_token and claude_token, in the chart's key names
Secret ops-agent-break-glass kubeconfig and github-token. They are mounted read-only, and KUBECONFIG points at the kubeconfig.
Secret harbor-pull Pull access to harbor.prod.skatzi.com/skatzi

The owner creates the Secrets once with kubectl create secret. They are never in Git, a task or an issue. #1451 extends the chart with a watchdog section for the CronJob, its Role and the session Job template. This is a second use of the same chart, not a second deployment path. - Images. #1451 makes the agent-runner image multi-arch (amd64 and arm64), with cilium and gh next to the chart's kubectl, flux and helm. It has no talosctl and no terraform. Harbor runs on hetzner-mgmt, so the image and chart versions are pinned, imagePullPolicy is IfNotPresent, and the DR Job uses the image the Deployment already has. When Harbor is down, nothing new has to be pulled.

3. Gitea Actions runners: their own VM, not the operator's

Superseded by ADR 0022. The premise below, that CI needs privileged Docker-in-Docker and so is root on its VM, no longer holds: the runners run rootless in a pod user namespace, get no root on the node, no node files and no kubelet credentials (ADR 0022 Q1, measured), and NetworkPolicies close ci to and from other namespaces. So they run in the namespace ci of the operator's VM, and there is no ci-runner account. The budget is one VM of 6 cores and 9 GiB, this section's two VMs added up. The egress policy's effect on the API server and the node is measured at install, before the break-glass kubeconfig goes into the VM (install).

The Gitea Actions runners move to the Mac mini too (milestone "Gitea Actions runners on the Mac mini",

1458). They use the same tooling (Lima, a boot daemon, the env check) but **a separate Lima

instance**, recommended as ci under its own macOS account, and not a namespace in ops.

CI jobs run code from pull requests in every organization, and they need Docker, which means privileged Docker-in-Docker or the VM's Docker socket. Either one is root on the VM it runs in. In the ops VM, that root could read ops-agent-break-glass, which is cluster-admin on hetzner-mgmt and cannot be revoked one by one. A separate VM puts a hypervisor boundary between the two, and gives each one a hard CPU and memory cap, so CI cannot starve the operator. #1458 sizes the ci instance.

Budget. The Mac mini has 10 cores, 16 GiB of memory and 25 GiB of free disk.

  • ops takes 2 cores and 4 GiB. Its disk image grows up to 20 GiB.
  • macOS, the mac-mini runner and the release runner need the rest of the memory, so ci should stay at or under 4 cores and 6 GiB.
  • Disk is the binding limit. The owner frees space so that at least 40 GiB stays free after both VMs (#1452 checks it).

4. Break-glass access that does not depend on the cluster

The operator's only break-glass access to hetzner-mgmt is the kubeconfig: cluster-admin in Kubernetes, and nothing below it. The owner generates and renews it on their own Mac with talosctl kubeconfig, because that needs the 1-bootstrap talosconfig, which never leaves the owner's Mac. The files are kept on the Mac mini under ~agent-ops/.dr/, with the directory at mode 0700 and each file at 0600. They are loaded into the Secret ops-agent-break-glass, and they are never committed, put in a task, or copied into a workspace.

File What
kubeconfig An admin client-certificate kubeconfig, context admin@mgmt-cluster, server https://78.47.74.196:6443. It uses no OIDC and no Keycloak.
github-token Not cluster access: a fine-grained PAT for DunkRing/bootstrap-cluster only, with Contents: read and write and Issues: read and write, for the Git fallback and the dr issues

The kubeconfig's client certificate is valid for a year. The watchdog opens a GitHub issue 30 days before it expires, so the owner can renew it.

The firewall is part of break-glass. If the home IP leaves admin_ip, the probes see "API down" although the cluster is fine. A DR session checks this first (runbook, step 0). When it finds this, it opens an issue that names the cause and changes nothing: the firewall is Terraform, so the owner fixes it.

5. The watchdog

Probe Check Starts a DR session after
Kubernetes API GET https://78.47.74.196:6443/readyz with the break-glass client certificate, 10 s timeout N = 5 min unreachable
Taskbase GET https://taskbase.skatzi.com/api/health, and one authenticated read that queries the database, as the runner's user, 10 s timeout each N = 5 min unreachable, timing out or answering 5xx
Gitea GET https://gitea.prod.skatzi.com/api/healthz never on its own; the DR prompt reports it
Flux Kustomizations and HelmReleases that are Ready=False, not suspended and not waiting on a dependsOn, with their Ready lastTransitionTime older than M M = 60 min. That is longer than ADR 0018's 30 minutes, so the alert route gets the first chance.

Rules:

  • One session at a time. The watchdog starts a session only when no DR Job is active. While one is active, it only records probe results.
  • One actor at a time. When a session starts, the watchdog scales the ops-agent Deployment to 0, so it claims nothing new. It scales it back to 1 when the Job ends. A run that was already in progress may finish within the runner's shutdown grace. The DR prompt says whether a runner pod was still terminating, so the session checks that run's changes before it writes anything.
  • Cool-down and cap. After a session, the same trigger starts no new session for 30 minutes. After 3 sessions in 6 hours with the trigger still failing, the watchdog stops starting sessions. It comments "needs a person" on the open dr issue, and waits until every probe has been green for 30 minutes.
  • The DR prompt holds:
  • the failing probes and their first-failure times;
  • the Gitea state;
  • the open dr issue's number;
  • the runbook path;
  • the guard rails.
  • Once a day, the watchdog checks the kubeconfig's certificate expiry. While Gitea is up, it also refreshes the cached operator persona from Skatzi/skatzi-agents personas/operator.md.

6. The local DR session

agent-runner gets a one-shot local-task mode, for example agent-runner run --local-task <file>. It runs one session with the Claude adapter, the cached operator persona and the DR prompt, and it needs no Taskbase: it does not register, claim or send heartbeats, and it has no MCP proxy.

  • Workspace. A clone of Gitea's Skatzi/platform, or of DunkRing/bootstrap-cluster when Gitea does not answer. The runbook is at the same path in both.
  • Recording. The session writes its run report to /dr/pending/<UTC time>.md. Once Taskbase is up again, an incident task is created in the Platform project (assignee operator, required_labels: ["role=ops"]) with the report in its description. A normal role=ops run then writes the incident report by pull request (#1343, #1349), and closes the GitHub issue.
  • Answered (amended 2026-10-24). A runner can create the task outside a claimed run, with POST /api/runners/{id}/incidents (Taskbase task #1463).

7. Scope: Kubernetes only (the owner rule of 2026-10-22)

The owner set this rule for now. It holds in every mode, not only in DR, and it is not a result of where the Terraform state happens to live:

  • No Terraform. No terraform binary in the image, and no Terraform state or credentials.
  • No Hetzner access. No HCLOUD_TOKEN, Hetzner API, Object Storage admin or Console credentials. The operator may still read the backup bucket through the restore Jobs that already run in the cluster.
  • No Talos. No talosctl, no talosconfig, and the watchdog does not probe the Talos API (50000).
  • Kubernetes and Talos upgrades stay manual, done by the owner (talosctl upgrade-k8s, talosctl upgrade). Renovate does not open them, and Taskbase never routes them to operator.
  • Failures below Kubernetes go to the owner. When the cause is in the nodes, Talos, the Hetzner network or firewall, or volumes at Hetzner, or the fix needs Terraform, the operator does not try to fix it. It records what it found and notifies the owner through the DR channel: the dr issue, or the incident task when Taskbase is up.

8. Guard rails in DR mode

These go into the DR prompt and the runbook, on top of the ops runbook's rules of engagement.

  1. Never delete PVCs, PVs, Hetzner volumes, buckets, objects in skatzi-backups, CNPG Backups or snapshots, and never delete a namespace or a CRD.
  2. Roll back first. The way back is the last good Git revision, then the backup gates' restore and rollback Jobs. Use direct helm rollback, flux suspend or flux resume only when GitOps itself is broken, and log each one.
  3. Stay in Kubernetes (§7): no Terraform, Hetzner or Talos, so node rebuilds, firewall changes, floating-IP moves and anything on a node go to the owner.
  4. Hand over, do not repair, below Kubernetes. When the API does not answer, nodes are NotReady, or volumes fail at Hetzner, the session collects the evidence it can get with kubectl and from outside (probe results, port checks, node conditions, events), puts it in the dr issue with exactly what it found, and ends.
  5. No Kubernetes minor downgrade, and no etcd member removal.
  6. Every DR session opens or reuses a GitHub issue with the label dr on DunkRing/bootstrap-cluster, and comments the result on it. Issues hold no secrets.
  7. Application data: one row, after a backup (amended 2026-11-15, #3215). The only write to an application's own data a session makes alone is a fix that stops a database crash loop: one row, addressed by its primary key, only after its on-demand CNPG Backup has completed, with the old values and the exact statement logged in the dr issue before it runs, so it can be reverted.

9. The DR drill

The drill breaks Taskbase's API on purpose and proves the chain: detection from outside, a session without Taskbase, the repair, and the record. The watchdog arms it (agent-runner watchdog drill arm), not an agent run, so no run that needs Taskbase outlives the outage it causes. The steps and the record are in the runbook.

10. The watchdog of the watchdog: com.skatzi.ops-env-check

Amended by ADR 0022: the instance it checks and restarts k3s in is k3s, not ops.

The watchdog cannot report that its own environment is broken. A second LaunchDaemon, com.skatzi.ops-env-check, runs as agent-ops every 5 minutes. Its script is in cluster/mac-mini/host/. It checks:

  1. limactl list ops shows Running;
  2. the local k3s answers /readyz;
  3. the watchdog CronJob's status.lastSuccessfulTime is less than 5 minutes old.

It repairs only in ways that keep launchd in charge:

  • k3s is down, or the watchdog does not tick: it restarts k3s inside the VM with limactl shell ops sudo systemctl restart k3s, at most once per 30 minutes.
  • The VM is not running: it does not run limactl stop, which would unload the boot daemon. Lima's daemon restarts a failed host agent on its own.

When a check still fails 10 minutes after the restart, or the VM stays down for 10 minutes, it opens a dr issue "ops environment broken on the Mac mini", using ~agent-ops/.dr/github-token. It never starts an agent itself.

Consequences

Positive

  • A broken CNI, API server or Flux no longer leaves only a person with a laptop to fix it. The owner learns of it through GitHub even when Mattermost is down.
  • One operational agent with one identity, one runbook and one queue label, for all four triggers.
  • The operator neither takes cluster resources nor depends on them, and it is isolated from the mac-mini runner by account, VM, credentials and labels.
  • The same chart serves hetzner-mgmt's runners and the Mac mini, and Renovate keeps both current.
  • The outside-in probes cover ADR 0018's deferred "probes from outside the cluster" for the API, Taskbase and Gitea.

Negative

  • One house, one machine. A power cut, an ISP outage or a full disk takes away the operator, for normal work as well as DR. Its absence shows only as ops-agent offline in Taskbase.
  • Normal ops work waits when the Mac mini is off, which an in-cluster agent would not.
  • Cluster-admin on a desktop machine. Kubernetes cannot revoke a client certificate on its own. If the certificate leaks, the fix is rotating the cluster CA, which is a person's job. The separate account, the separate VM, the encrypted Secrets and no copies in workspaces keep this risk small.
  • Failures below Kubernetes wait for the owner. A broken node, a Talos fault, a Hetzner network or volume problem, or a bad Kubernetes or Talos upgrade gets evidence and a dr issue, not a repair.
  • The firewall ties the operator to the home IP.
  • During an outage, pushes to GitHub main skip review. The Gitea pull request before the switch back is where review happens.
  • A VM, k3s and Flux to keep up on the Mac mini, and another Claude token.
  • Disk is tight (25 GiB free). A full disk stops the VM.

What we deferred (and what would trigger adding it)

Concept Trigger to add
A second role=ops runner outside the house (a small VM elsewhere) The Mac mini was offline during a cluster outage once, or for more than 24 h twice in a quarter
Terraform, Hetzner or Talos access for the operator (node rebuilds, talosctl rollback), which the owner ruled out for now (§7) The owner lifts the rule, for example after an outage below Kubernetes waited too long for them
E-mail as a second notification channel A dr issue went unseen for more than 2 hours once
A dead man's switch outside the house for the Mac mini itself ops-agent was found offline by chance rather than by a signal
A static egress IP, or a VPN to the cluster instead of admin_ip The Mac mini's public IP changed once
External Secrets in the local cluster from OpenBao A break-glass or runner credential had to be rotated by hand twice in a year

Implementation tasks

Task Repository Who
#1451 agent-runner: multi-arch image with cilium and gh (no talosctl, no terraform); the local-task mode; watchdog with the drill arm; the chart's watchdog section; a release agent-runner agent (senior-developer)
#1460 cluster/mac-mini/: the Lima template, Flux sync, the ops-agent HelmRelease and watchdog values, the env-check script and plist, the install docs (waits for #1451) platform agent (senior-developer)
#1452 The owner's install: the account, the Lima VM, Flux, the identities from #1329, the break-glass kubeconfig (generated and renewed by the owner), the Secrets, GitHub (waits for #1460) — person (owner)
#1453 Run the DR drill once and record it (waits for #1452) platform operator on dr=mac-mini
#1454 Fix the out-of-date node table in Talos OS Upgrade platform operator
#1458 Gitea Actions runners in their own Lima instance ci (§3; superseded by ADR 0022, rewritten in #1487) platform agent

Open questions

  1. How a runner creates an incident task in Taskbase outside a claimed run. #1451 decides this, and adds a Taskbase task if an endpoint is missing. Answered 2026-10-24: with POST /api/runners/{id}/incidents, built in Taskbase task #1463.