Watch
0
0
Fork
You've already forked hyperhive
0

require k8s: swarm services with a pod run in the cluster only

This commit is contained in:
atlas 2026-11-26 00:36:09 +01:00 • committed by maia
commit 44670249b6
9 changed files with 1044 additions and 3125 deletions

View file

@ -208,14 +208,15 @@ list-timers swarm-services-cert-renew` shows the next run.
## The controller's TCP listener has two leaves of its own
`swarm.controller.tcp.enable` adds a TLS listener to the swarm controller (default off). The
The swarm controller runs a TLS listener (`swarm.controller.tcp.enable`, on by default). The
controller checks nobody per request, so the listener finishes a handshake for one client only:
the gateway. Both ends hold a leaf from the store's `pki` mount, each through a role of its own on
the same mount and the same root:
- **Server leaf.** The `swarm-controller-tls` role issues for `swarm.controller.tcp.domain` alone,
`serverAuth` only. `swarm-controller-tls.service` on the controller's host requests it under the
controller's own store leaf, whose policy gains that one issue path.
`serverAuth` only. The pod's `tls-issue` init container requests it with its
ServiceAccount token, through the `swarm-controller` jwt role, whose policy has
that one issue path.
- **Gateway client leaf.** The `swarm-controller-gateway-client` role issues for
`gateway-client.<swarm.domain>` alone, `clientAuth` only. `swarm-controller-gateway-client.service`
on the host that runs the controller requests it under the services-issuer identity, whose policy
@ -229,9 +230,9 @@ handshake. Nginx verifies the controller's server leaf against the trust bundle,
Every host that holds the services-issuer identity can obtain the gateway client leaf, which is
every gateway host. The controller trusts exactly that identity: a gateway of this swarm.
Set `swarm.controller.tcp.enable` and `swarm.controller.tcp.domain` identically on every host. The
store's host writes both roles from them. A store host that leaves the option off has no role, and
the issuing unit fails with the store's refusal naming it.
Leave `swarm.controller.tcp.enable` and `swarm.controller.tcp.domain` at their defaults, or set them identically on every host. The
store's host writes both roles from them. A store host that turns the option off has no role, and
the pod's init container fails with the store's refusal naming it.
The listener reads the services root once at start. Replacing the root (about 30 years out) needs a
controller restart as well as new leaves.

View file

@ -7,7 +7,7 @@ to a repo's first run.
## Where it runs
A oneshot `swarm-ci-metrics.service` on a 5-minute timer, on the host that sets
A CronJob in the host's cluster on a 5-minute schedule, on the host that sets
`deploy.ci-metrics.enable`. `allSwarmServices` defaults it on wherever the host
has the poller's store identity, which the host that runs the store has. Run it
on one host per swarm: each poller keeps its own cursor, so two of them push
@ -27,10 +27,9 @@ with `invalid peer certificate: UnknownIssuer`.
### In the cluster
With `deploy.ci-metrics.runtime = "k8s"` (and `deploy.k8s.enable`) the host has
neither the service nor the timer, and the poller is a CronJob in the host's
cluster, on the timer's interval. A switch moves the poller, so one runs at any
time ([the runtime switch](../k8s/runtime.md)). The pod differs from the unit in
The host has neither the service nor the timer, and the poller is a CronJob in
the host's cluster, on the timer's interval ([the runtime module](../k8s/runtime.md)).
The pod differs from the unit in
three places:
- It pushes to the same route of the swarm collector, with the bearer it mints
@ -110,8 +109,8 @@ store then holds the same point twice in the same series, which changes no
panel. Deleting the file re-runs the backfill the same way.
A failed repo leaves its cursor where it was, the pass goes on with the next
repo, and the unit fails, so `systemctl status swarm-ci-metrics` shows it. The
timer runs it again 5 minutes later.
repo, and the Job fails, so `kubectl -n hyperhive get jobs` shows it. The
CronJob runs it again 5 minutes later.
## The board
@ -126,8 +125,8 @@ variable:
## Host setup
The CI run poller, a `swarm-ci-metrics` oneshot on a 5-minute timer on the host
that sets `deploy.ci-metrics.enable`. It runs on the host, not in a container.
The CI run poller, a CronJob on a 5-minute schedule in the cluster of the host
that sets `deploy.ci-metrics.enable`.
`allSwarmServices` defaults it on wherever the host has the poller's store
identity, as for the other swarm services. Set `deploy.ci-metrics.enable = false` to
opt out.

View file

@ -121,18 +121,18 @@ slow steps. `expired` counts logins stopped because their code never came.
## Host setup
The claude login minter, in a `swarm-claude-login` container on the host that
sets `deploy.claude-login.enable`. `allSwarmServices` defaults it on wherever
The claude login minter, a pod in the cluster of the host that sets
`deploy.claude-login.enable`. `allSwarmServices` defaults it on wherever
the host has the minter's store identity, like the other swarm services.
Run one: a login in progress lives in the service's memory between its start
and its code.
With `deploy.claude-login.runtime = "k8s"` it runs as a pod in the host's
cluster instead, and the host has no container. Each login's scratch directory
It runs as a pod in the host's cluster, and the host has no container. Each
login's scratch directory
is in the pod's `/tmp` volume, which is where `claude` writes its config, and
the pod's store login can write the agents' credentials as the container's
certificate does. Nothing moves in a switch: a login in progress ends, as it does
on a restart. See [the runtime switch](../k8s/runtime.md#the-claude-daemons).
certificate does. A login in progress ends when the pod restarts. See
[the runtime module](../k8s/runtime.md#the-claude-daemons).
An operator logs an agent in from the **log in** button on its card in the
swarm UI. swarm-controller relays the start and the pasted code over the queue,

View file

@ -514,24 +514,26 @@ The URL hooks register against is `deploy.swarm-controller.publicUrl`, default
whether the gateway reaches the controller by socket or by its TCP listener. Set it when another
URL fronts the controller.
## Reaching the controller over TCP (optional)
## Reaching the controller over TCP
By default the gateway reaches the controller through a unix socket on the same host. Setting
`swarm.controller.tcp.enable` and `swarm.controller.tcp.domain` on **every host of the swarm**
adds a TLS listener beside the socket and points the gateway's `/api/` and `/webhook/forge/`
locations at it by that name. Nothing else changes: the socket stays, and the operator gate on
`/api/` stays.
The controller runs as a pod in the host's cluster, so the gateway reaches it over a TLS
listener, never a unix socket. `swarm.controller.tcp.enable` defaults on and
`swarm.controller.tcp.domain` defaults to `controller.<swarm.domain>`, so nothing needs
setting, on every host of the swarm alike. The controller's host refuses to evaluate
with the listener off or with no swarm domain, naming the option. The gateway's `/api/` and `/webhook/forge/`
locations dial the pod's Service and verify the certificate as that name. The operator gate on `/api/` stays.
What you provide:
- `swarm.controller.tcp.domain`, resolvable from the gateway's host. Nginx resolves it when it
loads its config.
- Nothing for the name: `swarm.controller.tcp.domain` is only the name the listener's
certificate carries and the gateway verifies, because the gateway dials the pod's
Service.
- `deploy.swarm-controller.tcp.openFirewall = true` on the controller's host only when a gateway
on another host dials it. The port (`swarm.controller.tcp.port`, default 9443) stays closed
until you do, and `deploy.swarm-controller.tcp.listenAddress` picks the bound address.
With `deploy.swarm-controller.runtime = "k8s"` a ClusterIP Service publishes the
pod's listener. The gateway dials the Service's name,
The controller runs as a pod, and a ClusterIP Service publishes its
listener. The gateway dials the Service's name,
`swarm-controller.hyperhive.svc.cluster.local` by default, at the same port. The
hive's resolver answers it through the cluster's DNS, so `gateway.dns.enable`
has to be on. The gateway still verifies the certificate as

View file

@ -152,12 +152,12 @@ pieces fit, and the reasoning behind them, is in [`credentials.md`](../../2-hand
| the CI run poller's copy of its OIDC secret | authelia's mint, which creates it in the swarm secret store | `swarm-ci-metrics` reads `swarm/services/<swarm.ci-metrics.clientId>/oidc/client` once per pass under its own leaf, and again when authelia refuses it; memory only. While it differs from authelia's, the token request fails, nothing gets pushed and no cursor moves | same leaf, nothing else |
| authelia's container's journal forwarder's OIDC secret | authelia's mint, in its container, like every client's secret (`swarm.authelia.otel.clientId`). It creates it at `swarm/services/<id>/oidc/client`, and `swarm-journal-forwarder-oidc.service` in the same container reads it back under the secret publisher's leaf, at start and every 10 minutes | `/run/swarm-journal-forwarder-oidc/client-secret` on the container's tmpfs, root `0400`; `LoadCredential` hands it to the collector. | none: the forwarder runs only in authelia's container, and is off there without the publisher's leaf |
| authelia subject store | `swarmctl` and `swarm-authelia-bridge` | `users.yml` — one file, read and written by both | `swarmctl`, on the host that runs authelia |
| queue auth-callout nkeys (user seed + account seed) | `swarm-nats-auth ensure-callout-keys`, run by `swarm-bao-nats-callout-xkey` on the queue's host when the store holds no seed (with `deploy.nats.runtime = "k8s"`, by the pod's `callout-config` init container under the `swarm-nats-auth` jwt role); the verb stores a seed it finds at `/var/lib/swarm-nats-callout/{callout-user,issuer}.seed` as is, then removes the file | the swarm secret store: the seeds at `swarm/services/swarm-nats/callout/{user,issuer}-seed`, read by the `swarm-nats-auth` role alone; the public halves at `swarm/public/swarm-nats/callout-{user,issuer}` | nothing to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) |
| queue auth-callout xkey (curve seed) | `swarm-nats-auth ensure-callout-keys`, run by `swarm-bao-nats-callout-xkey` on the queue's host when the store holds no seed (with `deploy.nats.runtime = "k8s"`, by the pod's `callout-config` init container under the `swarm-nats-auth` jwt role) | the swarm secret store: the seed at `swarm/services/swarm-nats/callout/xkey-seed`, read by the `swarm-nats-auth` role alone; the public half at `swarm/public/swarm-nats/callout-xkey` | nothing to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) |
| queue auth-callout nkeys (user seed + account seed) | `swarm-nats-auth ensure-callout-keys`, run by the pod's `callout-config` init container under the `swarm-nats-auth` jwt role when the store holds no seed | the swarm secret store: the seeds at `swarm/services/swarm-nats/callout/{user,issuer}-seed`, read by the `swarm-nats-auth` role alone; the public halves at `swarm/public/swarm-nats/callout-{user,issuer}` | nothing to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) |
| queue auth-callout xkey (curve seed) | `swarm-nats-auth ensure-callout-keys`, run by the pod's `callout-config` init container under the `swarm-nats-auth` jwt role when the store holds no seed | the swarm secret store: the seed at `swarm/services/swarm-nats/callout/xkey-seed`, read by the `swarm-nats-auth` role alone; the public half at `swarm/public/swarm-nats/callout-xkey` | nothing to place beyond the responder's store leaf (`deploy.nats.authBaoClientCertFile`) |
| the queue's TLS key, copied for the gateway's `/metrics` vhost | `swarm-nats-gateway-cert.service` on the queue's host, where the gateway uses self-signed TLS: a copy of the queue's bao-PKI TLS leaf (`/var/lib/swarm-nats-tls/`) once `swarm-bao-nats-tls` has issued it, else a throwaway 30-day self-signed pair for the queue's name until then | `/var/lib/swarm-nats-gateway-tls/{cert,key}.pem`; the key is `0640` group `nginx`, read by nginx for the queue's `/metrics` vhost. The queue's own key stays `0600` root | the copy is redone on each leaf renewal (`swarm-bao-nats-tls` starts the unit, which queues a non-blocking nginx reload when nginx is running); a restart before any leaf exists keeps the pair already there. Until `swarm-bao-nats-tls` issues the leaf the vhost serves the throwaway cert, so the collector's scrape fails TLS. Nothing for an operator to place |
| the queue pod's TLS leaf and key | the pod's `tls-issue` init container, only with `deploy.nats.runtime = "k8s"`: it logs in with the pod's ServiceAccount token as the store's `swarm-nats` jwt role, which has the policy of the `swarm-nats` cert role, and issues one name, `swarm.nats.domain`. The host keeps `swarm-bao-nats-tls`, which issues its own copy for the gateway's `/metrics` vhost and restarts no server | `/var/lib/swarm-nats-tls/{cert,key}.pem` in an in-memory `emptyDir` (`medium: Memory`), gone with the pod. The server reads both as it starts and again on `SIGHUP`; the key never reaches the node's disk | the pod's `tls-renew` container repeats the check every five minutes, issues a new leaf once the old one is past half its 30 days and signals the server, so a long-running pod needs nothing. Nothing to place: the pod's account is the credential |
| the controller's TCP listener certificate and key | `swarm-controller-tls.service` on the controller's host, only where you set `swarm.controller.tcp.enable`. It logs in under the controller's own store leaf and issues from the store's `swarm-controller-tls` role: one name, `swarm.controller.tcp.domain`, `serverAuth` only. On the host, a daily timer renews it past half its life. With `deploy.swarm-controller.runtime = "k8s"` the host has no unit: the pod's init container issues the leaf into an in-memory `emptyDir` under its ServiceAccount token, and its `tls-renew` container repeats the same check daily, because nothing rolls the pod before the leaf expires | On the host, `<deploy.swarm-controller.tcp.tlsDir>/{cert,key}.pem` (`/var/lib/swarm-controller-tls`), the key `0640` group `swarm-controller`. In the pod, the same two files in an in-memory `emptyDir` (`medium: Memory`), gone with the pod. The daemon re-reads both when they change, so a rotation restarts nothing. A store host that leaves the option off has no role to issue from, and the unit fails with the store's refusal naming it | Nothing to place: the controller's own store leaf is the one it already holds |
| the gateway's client certificate for the controller's TCP listener | `swarm-controller-gateway-client.service` on the host that runs the controller, only where you set `swarm.controller.tcp.enable`. It logs in under the services-issuer identity and issues from the store's `swarm-controller-gateway-client` role: one name, `gateway-client.<swarm.domain>`, `clientAuth` only, so the services leaf can't stand in for it. A daily timer renews it | `<deploy.hive-controller.tls.stateDir>/controller-client.pem` and `controller-client-key.pem`, the key `0640` group `nginx`; the gateway's controller locations name them in `proxy_ssl_certificate`. Until the store answers, a throwaway self-signed pair keeps nginx's config loadable. The listener refuses that pair, so those locations answer 502. Every holder of the services-issuer identity can obtain this leaf: the listener trusts "a gateway of this swarm" | Nothing to place: the services-issuer identity is the one every gateway host already holds |
| the queue pod's TLS leaf and key | the pod's `tls-issue` init container: it logs in with the pod's ServiceAccount token as the store's `swarm-nats` jwt role, which has the policy of the `swarm-nats` cert role, and issues one name, `swarm.nats.domain`. The host keeps `swarm-bao-nats-tls`, which issues its own copy for the gateway's `/metrics` vhost and restarts no server | `/var/lib/swarm-nats-tls/{cert,key}.pem` in an in-memory `emptyDir` (`medium: Memory`), gone with the pod. The server reads both as it starts and again on `SIGHUP`; the key never reaches the node's disk | the pod's `tls-renew` container repeats the check every five minutes, issues a new leaf once the old one is past half its 30 days and signals the server, so a long-running pod needs nothing. Nothing to place: the pod's account is the credential |
| the controller's TCP listener certificate and key | the pod's init container, while `swarm.controller.tcp.enable` is on (the default). It issues the leaf into an in-memory `emptyDir` from the store's `swarm-controller-tls` role under its ServiceAccount token: one name, `swarm.controller.tcp.domain`, `serverAuth` only. Its `tls-renew` container repeats the same check daily, because nothing rolls the pod before the leaf expires | `<deploy.swarm-controller.tcp.tlsDir>/{cert,key}.pem` (`/var/lib/swarm-controller-tls`) in the pod, in an in-memory `emptyDir` (`medium: Memory`), gone with the pod. The daemon re-reads both when they change, so a rotation restarts nothing. A store host that leaves the option off has no role to issue from, and the init container fails with the store's refusal naming it | Nothing to place: the controller's own store leaf is the one it already holds |
| the gateway's client certificate for the controller's TCP listener | `swarm-controller-gateway-client.service` on the host that runs the controller, while `swarm.controller.tcp.enable` is on (the default). It logs in under the services-issuer identity and issues from the store's `swarm-controller-gateway-client` role: one name, `gateway-client.<swarm.domain>`, `clientAuth` only, so the services leaf can't stand in for it. A daily timer renews it | `<deploy.hive-controller.tls.stateDir>/controller-client.pem` and `controller-client-key.pem`, the key `0640` group `nginx`; the gateway's controller locations name them in `proxy_ssl_certificate`. Until the store answers, a throwaway self-signed pair keeps nginx's config loadable. The listener refuses that pair, so those locations answer 502. Every holder of the services-issuer identity can obtain this leaf: the listener trusts "a gateway of this swarm" | Nothing to place: the services-issuer identity is the one every gateway host already holds |
| the secret store's own contents | openbao, on first `bao operator init` — **an operator action, not a unit** | inside the `swarm-bao` container, at its own `/var/lib/openbao`, kept across rebuilds by `ephemeral = false`. ⚠️ **Not a host path**: `nixos-container destroy swarm-bao` takes the raft data with it, so back up the container's tree, not `/var/lib/`. Only the store's TLS material (`/var/lib/swarm-bao-tls`) and its PKCS11 token (`/var/lib/swarm-bao-token`) are host-level | n/a — there is one store; a hive elsewhere is a _client_ of it and holds none of this |
| the secret store's unseal material | the HSM/TPM under `deploy.bao.seal = "pkcs11"`; openbao itself under `"shamir"` | in the token; or held by whoever ran `bao operator init`, which is what `"shamir"` means and why it's stated rather than inferred | n/a — only the host running the store seals anything |
| a cluster pod's store login token (a ServiceAccount token) | the cluster's API server, which signs it for the pod's account and the audience `bao`. The kubelet projects it into the pod and rewrites it before it expires | `/var/run/secrets/hyperhive/bao/token` in the pod. The store accepts it at its `jwt-k8s` mount, for the role of that account only, against the public halves of the node's signing keys, which `swarm-bao-k8s-jwt-policy` derives from the key files. A node whose signing keys changed needs that unit restarted, and tokens signed with the old key fail to log in meanwhile | Nothing to place: the pods and the store run on the cluster's one host |

View file

@ -40,7 +40,9 @@ under `deploy.nats` or `swarm.nats`, fails at eval with a message naming the
option and where the keys live now.
To replace either key, delete both of its paths the way the xkey's section
below shows for the xkey, then restart `swarm-bao-nats-callout-xkey`.
below shows for the xkey, then delete the queue's pod (`kubectl -n hyperhive delete pod
--selector app.kubernetes.io/name=swarm-nats`): its init container creates the keys
again.
One consequence worth knowing before you debug it: the queue assembles its
config each time the server starts rather than at build time, in every mode,
@ -63,14 +65,14 @@ Only the `swarm-nats-auth` role reads either path, and it may create each but
never replace it. The policy of `swarm-secret-publisher`, which writes the rest
of `swarm/services/`, denies it the seed's path.
On the queue's host, `swarm-bao-nats-callout-xkey` runs before the
`swarm-nats` container, under the responder's store leaf:
The queue pod's `callout-config` init container runs before the server and the
responder, under the pod's `swarm-nats-auth` login:
1. `swarm-nats-auth ensure-callout-keys` creates the pair when the store holds no
seed, and otherwise only reads it. It needs no queue, so on a first boot
the key exists before the server that needs it.
2. It reads the public half back from the store into
`/var/lib/nats-callout/callout-xkey.pub` inside the container.
`/var/lib/nats-callout/callout-xkey.pub` in the pod's config volume.
3. Each time `nats-server` starts, it renders that key into
`auth_callout.xkey`. With no file, the server doesn't start.
4. The responder starts after the server and reads the seed from the store.
@ -78,31 +80,15 @@ On the queue's host, `swarm-bao-nats-callout-xkey` runs before the
requests it can't open.
The store has to be reachable each time the responder starts. When it's down,
the fetch unit fails and retries for a day. The server starts with the key
fetched last time, or not at all on a first boot. A responder that starts
the init container fails and the pod doesn't start its server. A responder that starts
while the store is down exits and retries, first after 5 seconds and then
after longer waits up to a minute, and until one start reads the seed the
queue refuses every client, OIDC ones included. The retry that lands the file
starts or restarts the server, and the responder comes up with it.
starts the server, and the responder comes up with it.
The responder always comes back. Its unit has `Restart=always` and no start
limit, so a burst of starts can't leave it failed. A stop that comes from the
server failing isn't a restart trigger, so every host script that restarts
the server in `swarm-nats` (`swarm-bao-nats-tls` on a leaf rotation,
`swarm-bao-nats-callout-xkey` after fetching the keys) also clears the
responder's failed state and starts it. Those scripts use `start`, not
`restart`: the server's restart already restarts a running responder, which loads
the current seeds.
Those starts can still fail: a start job fails when a unit the responder
requires, the server or the container's trust bundle, fails first, and a
failed job leaves the responder inactive, out of `Restart=`'s reach. Both
units therefore uphold it (systemd's `Upholds=`): while either one runs, systemd starts
an inactive or failed responder, and the unit that comes up last starts it with
both up. This also means stopping the responder or the server by hand inside
the container lasts only as long as the stop itself: systemd starts the
responder again, and the responder pulls the server back in. To keep it down,
mask it, or stop the container.
The responder is the pod's main container: the kubelet restarts a container that
exits, and a deleted pod starts the server and the responder again, so the
responder loads the current seeds.
The responder's store leaf is `deploy.nats.authBaoClientCertFile` /
`authBaoClientKeyFile`. On the store's host both default to the leaf
@ -114,26 +100,22 @@ name it in both options. Until you do, evaluation fails naming both.
Where the queue and the store run on different hosts, deploy the store's host
first. `swarm-bao-nats-auth-policy` there writes the role's grants on the
keys' paths, and `swarm-bao-secret-publisher-policy` the publisher's denial of
the seeds' paths; where the queue runs on that host too, the fetch waits for
both. A queue host deployed before it can't read or create the keys, so its
fetch fails, and the queue refuses every client until you deploy the store's
host: the server starts only on public keys fetched before, and the responder
can't load its seeds. Seed files the import is waiting for stay where they
are. If that takes longer than the fetch's day of retries, run
`systemctl restart swarm-bao-nats-callout-xkey` on the queue's host.
the seeds' paths. A queue host deployed before it can't read or create the keys, so
its init container fails, and the queue refuses every client until you deploy
the store's host: the server doesn't start, and the responder can't load its seeds. If that takes longer than the init container's retries, delete the queue's
pod.
Two starts that create the key at once can't both win: each write is a
create that fails once the path holds anything, and the start that lost reads
the winner's key back.
To replace the key, remove both paths with their metadata and every version,
then restart the fetch unit on the queue's host. Its restart of `nats.service`
restarts the responder too, which then loads the new seed:
then delete the queue's pod. The new pod's responder loads the new seed:
```sh
bao kv metadata delete secret/swarm/services/swarm-nats/callout/xkey-seed
bao kv metadata delete secret/swarm/public/swarm-nats/callout-xkey
systemctl restart swarm-bao-nats-callout-xkey
kubectl -n hyperhive delete pod --selector app.kubernetes.io/name=swarm-nats
```
`bao kv delete` isn't enough. It deletes the latest version but keeps the

View file

@ -436,15 +436,15 @@ behind. The router reads the consumer counts at the start of each pull, at most
## Host setup
The notification router, in a `swarm-notify-router` container on the host
The notification router, a pod in the cluster of the host
that sets `deploy.notify-router.enable`. `allSwarmServices` defaults it on
wherever the host has the router's store identity, on the review classifier's
terms. Run one: it handles each issue's events in order.
With `deploy.notify-router.runtime = "k8s"` on a host that runs the cluster
(`deploy.k8s.enable`), the router runs as a pod and the host has no container.
The router keeps nothing on the host, so the switch copies nothing; see
[the runtime switch](../k8s/runtime.md).
The router runs as a pod in the host's cluster (`deploy.k8s.enable`, which the
router turns on by default), and the host has no container. The router keeps
nothing on the host, so an upgrade copies nothing; see
[the runtime module](../k8s/runtime.md).
swarm-controller keeps every `issues` and `pull_request` delivery, and every
failed or cancelled CI run, from its instance-wide hooks in the `SWARM_EVENTS`

View file

@ -776,18 +776,18 @@ These get settled, and filled in here, as the work reaches them:
## Host setup
The review classifier's try-out service, in a `swarm-review-classifier`
container on the host that sets `deploy.review-classifier.enable`.
The review classifier's try-out service, a pod in the cluster of the host that
sets `deploy.review-classifier.enable`.
`allSwarmServices` defaults it on wherever the host has the classifier's store
identity: the host that runs the store has it, and a services host with the
store elsewhere gets the classifier only once it holds a copy of the pair (see
below). Set `deploy.review-classifier.enable` directly to override either way.
With `deploy.review-classifier.runtime = "k8s"` it runs as a pod in the host's
cluster instead, and the host has no container. Each run's scratch directory
It runs as a pod in the host's cluster, and the host has no container. Each
run's scratch directory
and its `HOME` are in the pod's `/tmp` volume. The pod's network isn't
restricted, and the ACP runtime's `base_url` comes from the run. See
[the runtime switch](../k8s/runtime.md#the-claude-daemons).
[the runtime module](../k8s/runtime.md#the-claude-daemons).
The operator sets the key of the runtime the swarm settings choose in the
swarm UI: the **classifier settings** card on `/jobs` takes a key for the

View file

@ -84,7 +84,7 @@ choices behind the defaults.
## Host setup
The speech-to-text service, in a `swarm-stt` container on the host that sets
The speech-to-text service, a pod in the cluster of the host that sets
`deploy.stt.enable`. `allSwarmServices` defaults it on wherever the host has the
service's store identity, like the other swarm services. Run it where the inference
hardware is: it transcribes with whisper.cpp.
@ -97,15 +97,15 @@ model (`small` by default, or `base`), and `modelFile` takes any other ggml
model. The cache time, the limits on file size, audio length and run time, and
how many requests it holds at once are settings next to it.
With `deploy.stt.runtime = "k8s"` on a host that runs the cluster
(`deploy.k8s.enable`), the service runs as a pod and the host has no container.
The service runs as a pod in the host's cluster (`deploy.k8s.enable`, which the
service turns on by default), and the host has no container.
The pod has the unit's memory and CPU ceilings as limits and its cache on a
volume of the cluster. The systemd sandbox stays on the host, and the pod has
the security shape every pod has, in a user namespace of its own as the unit has
`PrivateUsers`. The pod's NetworkPolicy lets it reach cluster DNS and the store,
identity provider, queue and hive collector on the host and nothing else, and
admits no ingress. Nothing moves in a switch, so each side keeps the cache it
last had; see [the runtime switch](../k8s/runtime.md).
admits no ingress. An upgrade from the container doesn't carry its cache over; see
[the runtime module](../k8s/runtime.md).
The audio comes from rooms with outside people, so the service runs as its own
unprivileged user under a tight systemd sandbox, with a memory ceiling and a CPU