diff --git a/docs/4-implementation/k8s/manifests.md b/docs/4-implementation/k8s/manifests.md index aa9d46eb5..1dfb0f10f 100644 --- a/docs/4-implementation/k8s/manifests.md +++ b/docs/4-implementation/k8s/manifests.md @@ -23,7 +23,7 @@ A service gets manifests on the host whose configuration deploys it: | ------------------------- | ---------- | ------------------------------------------------------------------------------------------------ | | `swarm-controller` | Deployment | ServiceAccount, PersistentVolumeClaim `swarm-controller-state`, ConfigMap `swarm-controller-etc` | | `swarm-notify-router` | Deployment | ServiceAccount | -| `swarm-stt` | Deployment | ServiceAccount, PersistentVolumeClaim `swarm-stt-state` | +| `swarm-stt` | Deployment | ServiceAccount | | `swarm-review-classifier` | Deployment | ServiceAccount | | `swarm-claude-login` | Deployment | ServiceAccount | | `swarm-ci-metrics` | CronJob | ServiceAccount, PersistentVolumeClaim `swarm-ci-metrics-state` | diff --git a/docs/4-implementation/k8s/migrate.md b/docs/4-implementation/k8s/migrate.md index 8a52aca8f..e570efe67 100644 --- a/docs/4-implementation/k8s/migrate.md +++ b/docs/4-implementation/k8s/migrate.md @@ -80,15 +80,15 @@ for every storage class. endpoints the [services page](../../2-handbook/swarm/services.md) lists; the [readiness page](../swarm/readiness.md) has their mechanics. -| service | state | what moves | readiness signal | cut-over and rollback | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `swarm-notify-router` | in the queue: a state bucket and a durable consumer on the forge events stream | nothing | `/readyz`: queue connected | `runtime = "k8s"`, rebuild; back with `runtime = "host"` | -| `swarm-review-classifier` | none on disk; its runs and settings live in buckets the controller owns | nothing | `/readyz`: queue connected | same | -| `swarm-claude-login` | none; credentials it writes go to the store | nothing; a login in progress ends | `/readyz`: queue connected | same | -| `swarm-stt` | the transcript cache, entries live 24 h | nothing; the pod starts with an empty cache, once the gate has its marker | `/readyz`: queue connected | same | -| `swarm-ci-metrics` | `cursor.json` in the state directory; losing it re-pushes every run | the state directory, to a PVC | the CronJob's next Job completes | `runtime = "k8s"`, rebuild; the timer goes, the CronJob runs. Rollback copies the PVC back | -| NATS + `swarm-nats-auth` | JetStream's `store_dir`: the swarm's desired state, operator profiles, schedules and run records. `swarm-nats-auth` keeps nothing | the whole `store_dir`, to a PVC; the cut-over rebuild stops NATS, so the copy reads a quiescent tree | nats-server's `/healthz?js-enabled-only=true` and `swarm-nats-auth`'s `/readyz`; Ready when both pass | `runtime = "k8s"`, rebuild; the pod takes the same host port, so hives keep their URL. Rollback copies the PVC back | -| `swarm-controller` | its state directory: the operator-admin set, the legacy `webhook-secret` fallback and the forge avatar markers. The rest sits in the queue or the store | the state directory, to a PVC | `/readyz` on the controller's plain health listener | `runtime = "k8s"`, rebuild; the same rebuild points the gateway's `/api/` and `/webhook/forge/` upstreams at the controller's TCP listener. Rollback copies the PVC back and returns the upstreams to the socket | +| service | state | what moves | readiness signal | cut-over and rollback | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `swarm-notify-router` | in the queue: a state bucket and a durable consumer on the forge events stream | nothing | `/readyz`: queue connected | `runtime = "k8s"`, rebuild; back with `runtime = "host"` | +| `swarm-review-classifier` | none on disk; its runs and settings live in buckets the controller owns | nothing | `/readyz`: queue connected | same | +| `swarm-claude-login` | none; credentials it writes go to the store | nothing; a login in progress ends | `/readyz`: queue connected | same | +| `swarm-stt` | the transcript cache, entries live 24 h; the pod keeps it in an `emptyDir` | nothing; the pod starts with an empty cache | `/readyz`: queue connected | same | +| `swarm-ci-metrics` | `cursor.json` in the state directory; losing it re-pushes every run | nothing; the pod starts on an empty PVC with no gate, and its first pass re-pushes every run as the same points | the CronJob's next Job completes | `runtime = "k8s"`, rebuild; the timer goes, the CronJob runs; back with `runtime = "host"` | +| NATS + `swarm-nats-auth` | JetStream's `store_dir`: the swarm's desired state, operator profiles, schedules and run records. `swarm-nats-auth` keeps nothing | the whole `store_dir`, to a PVC; the cut-over rebuild stops NATS, so the copy reads a quiescent tree | nats-server's `/healthz?js-enabled-only=true` and `swarm-nats-auth`'s `/readyz`; Ready when both pass | `runtime = "k8s"`, rebuild; the pod takes the same host port, so hives keep their URL. Rollback copies the PVC back | +| `swarm-controller` | its state directory: the operator-admin set, the legacy `webhook-secret` fallback and the forge avatar markers. The rest sits in the queue or the store | the state directory, to a PVC | `/readyz` on the controller's plain health listener | `runtime = "k8s"`, rebuild; the same rebuild points the gateway's `/api/` and `/webhook/forge/` upstreams at the controller's TCP listener. Rollback copies the PVC back and returns the upstreams to the socket | Two facts the table rests on: @@ -108,18 +108,16 @@ Two facts the table rests on: 1. **`swarm-notify-router` alone.** The first cut-over proves the runtime switch, the image, the store identity and reaching the host-run NATS by name, with nothing to copy. -2. **`swarm-review-classifier`, `swarm-claude-login`, `swarm-stt`**, in one - rebuild or one at a time. No state, same pattern as step 1. -3. **`swarm-ci-metrics`.** The first copy, of one small file. It exercises - the snapshot, the gate, the copy and the rollback on state whose loss - costs a re-push, not data. -4. **NATS with `swarm-nats-auth`.** The riskiest move: the largest copy, every +2. **`swarm-review-classifier`, `swarm-claude-login`, `swarm-stt`, + `swarm-ci-metrics`**, in one rebuild or one at a time. Nothing to copy, same + pattern as step 1: the pods start with no gate on an empty volume. +3. **NATS with `swarm-nats-auth`.** The riskiest move: the largest copy, every hive and agent disconnects, and the data is the swarm's desired state. - The copy path has run once by then. `swarm-nats-auth` moves in the same - pod, because it answers the auth callout on every connect and dials the + It's the first copy `swarmctl migrate` makes. `swarm-nats-auth` moves in the + same pod, because it answers the auth callout on every connect and dials the server by name, which the pod's host aliases map to its loopback. -5. **`swarm-controller` last.** - - It's the operator's view of the swarm. Kept on the host through step 4, +4. **`swarm-controller` last.** + - It's the operator's view of the swarm. Kept on the host through step 3, it reports from an unchanged place whether the hives reconnected after the NATS move, and `swarmctl` keeps its local socket for the checks. - Its cut-over also changes the gateway's upstream and ends the local @@ -214,9 +212,7 @@ stops a workload leaves its PVC in place, so the data survives until `finish`. A fresh install straight onto k8s has no host state to copy: with `deploy..k8s.freshState` on, the gate marks the empty volume itself -(`{"fresh": true, "at":