Watch
0
0
Fork
You've already forked hyperhive
0
Commit graph hyperhive/nix/host-modules
Author SHA1 Message Date
maia
6a50769269 k8s: the store-credential unit starts at fork, off the boot and switch path
`swarm-bao-store-auth` was a retrying oneshot on multi-user.target. A
oneshot's start job stays pending through its restarts, so a boot or a switch
with the secret store sealed waited on it for up to 15 minutes, the same
shape as #6901's CA publisher.

It is now `Type=simple` with the shared retry kept: the start job is done at
fork and the unit keeps trying until the store answers. `RemainAfterExit`
leaves it `active (exited)` once the credential is out, and the 15-minute
start timeout goes, as a start job done at fork has no use for it. Nothing
orders after the unit: the gateway reads the file at its next reload and the
pods wait in ContainerCreating for the Secret.

`is-active` is now true while the script runs and `systemctl restart` returns
at fork, so the k8s-services and k8s-nats tests wait for `SubState=exited` where they relied
on either.

Closes #6937
2026-11-27 21:59:28 +01:00
atlas
893b693b46 the queue's exporter asks every request for a login the gateway supplies 2026-11-27 21:37:14 +01:00
atlas
f54aae7927 the log and metrics stores ask every request for a credential the gateway supplies
Each store runs with -httpAuth.* and a credential from the secret store, published to the namespace as a Secret by the host. The gateway's locations send it after auth_request has passed, and the collector's scrape and push take the same one, so a process on the node that bypasses the gateway is refused.
2026-11-27 21:30:12 +01:00
atlas
07a004fad1 run the metrics store and its auth responders as pods 2026-11-27 21:30:12 +01:00
atlas
67218f4052 k8s: deny ingress to every pod by default 2026-11-27 21:30:12 +01:00
atlas
b3c5113d53 k8s: the ca-trust publisher no longer holds multi-user.target while it waits for the setup 2026-11-27 21:30:12 +01:00
atlas
40dd9a6303 k8s-services: seed with the stream content type, give the grafana responder its own port name, and print gateway diagnostics on a refusal
the grafana responder's service targeted the port name api, which resolves to the logs responder's container; its port is now grafana-api.

the node-ready wait is raised from 300 to 600 seconds: slow k3s image imports on this test's machine kept the node from registering in vm-nightly 8992 and 8997, so the test never reached the subtests this change fixes.
2026-11-27 21:30:12 +01:00
atlas
4bb6c573ae swarm-nats: the pod's raw rule lets through the interfaces the firewall opens the client port on
The hostPort's raw-table drop for the queue's client port let through only the host's loopback, the bridge and the pods' interfaces, so a hive on another host, reaching the queue over wg0 where the firewall's own rule opens the port, timed out. The rule now also returns for every interface whose networking.firewall.interfaces entry opens the port. semi-spread dumps the queue's network state when the hive cannot reach it, and asserts the port answers over wg0 and not on the public address.
2026-11-27 21:30:12 +01:00
maia
bd7c261078 k8s: refuse a workload name that starts with the legacy hive- prefix
The forge and matrix services carry a hive- prefix from their per-hive
container days. Neither runs in the cluster on k8s/v1 yet, so nothing
is renamed here: the renderer now fails the evaluation of any in-cluster
workload that carries a name starting with hive- (an object key, an
object's name, or its app label), so the move cannot bring the prefix
along. A module-eval case pins the lookup on literals and holds the
rendered hosts to it.
2026-11-27 21:30:12 +01:00
atlas
dca4720b7b run the log store and its auth responders as pods
swarm-logs-auth and swarm-metrics-auth take --listen for a TCP address beside
--socket. The log store is a Deployment on a static local volume that is its
old container's data directory, behind a ClusterIP Service the gateway dials by
name. Its two auth_request responders are one unpinned pod with a jwt role.
The renderer gains a plain HTTP listener, a probe path, fsGroupChangePolicy,
and one policy for a pod with both a listener and egress.
2026-11-27 21:30:12 +01:00
atlas
ee6b5f69f6 full-setup and the host swarmctl reach the controller as a pod, not through a host socket 2026-11-27 21:29:38 +01:00
atlas
44670249b6 require k8s: swarm services with a pod run in the cluster only 2026-11-27 21:29:38 +01:00
atlas
23865cb223 let a second machine join the main node's k3s and run pods from images only the main node holds 2026-11-27 21:29:38 +01:00
atlas
89308e8ba5 pin queue and poller state to per-service node labels instead of the hostname 2026-11-27 21:29:38 +01:00
maia
9be6c57a3e swarmctl setup status: show the pending bootstrap re-run for the pods' login
`swarm-bao-k8s-jwt-policy` exits 0 when the bootstrap token lacks
`sys/auth/jwt-k8s`, so a store set up before the node looked fine in
`swarmctl setup status`: the unit is active and nothing marks the root-only
`swarmctl bao grant-bootstrap` re-run as pending.

The unit now keeps /run/swarm-bao-k8s-jwt-pending while it stays off and
removes it before it writes the mount's config. `setup status` reads the file
and shows step 3, "granter bootstrapped", as not done, naming the verb.
`module-eval-k8s` pins the order of the touch, the exit and the removal.
2026-11-27 21:29:38 +01:00
maia
f9e9101458 swarm-nats: order the host queue's callout-key unit after the prune
A switch back deletes the queue's pod with --wait, so the pod is still
ending while swarm-nats-k8s-prune runs. swarm-bao-nats-callout-xkey was
ordered before the container but not after the prune, so on a slow
apiserver its ensure-callout-keys ran beside the pod's responder and the
switch test saw two responders. On a host with the cluster node the unit
now starts after the prune. The prune names the unit nowhere, so there is
no cycle, and without the node nothing changes.

Closes #6831
2026-11-27 21:29:38 +01:00
atlas
0f0ed38d4b remove swarmctl migrate, migrate.json and the migrate docs 2026-11-27 21:29:38 +01:00
atlas
31f5438d36 k8s: the hyperhive namespace enforces pod security restricted
No pod in the namespace has a hostPort any more, and the census found nothing else that restricted refuses. The namespace now carries the restricted level for enforce, warn and audit, so the API server refuses a pod that drifts. The bao-login test's probe pods get the container security context restricted asks for. The controller switch test shows the API server admitting a compliant pod and refusing the same pod with a host port, a kept capability or privilege.
2026-11-27 21:29:38 +01:00
atlas
d93d4c07f6 k8s: the queue's client port is a loadbalancer service
The queue's client port was a hostPort on 0.0.0.0, which Pod Security baseline and restricted forbid. It is a LoadBalancer Service now, which k3s's service load balancer binds on every address of the node with a hostPort of its own in kube-system, so hives on other hosts keep their URL. No node port is allocated. The stt policy allows the load balancer's pods in place of the queue's, and the prune unit waits for them to go before the host unit starts. The egress published-port rule and the raw-table rules apply to the load balancer's hostPort as to the pod's.
2026-11-27 21:29:38 +01:00
atlas
e7ccc41652 egress: the forward chain accepts the flows the host publishes for the agents
On a host with the egress intercept on, the forward chain rejected an agent's traffic to the queue once the queue ran as a pod: the pod's hostPort rewrites the destination to the pod, and the packet then leaves the bridge for the cluster. The chain now accepts TCP that the host's NAT redirected whose original destination is the bridge's address at a published port, which the queue adds when it runs in the cluster. Everything else from the bridge to the cluster stays refused. The nats switch test runs with the intercept on.
2026-11-27 21:29:38 +01:00
atlas
e29a8e71f3 k8s: the queue's exporter is a ClusterIP service only the node reaches
The exporter's metrics port was a hostPort on the bridge's address, which Pod Security baseline and restricted forbid. It is a ClusterIP Service now, and the pod has a NetworkPolicy that admits the client port from any source and nothing else, so only the node reads the exporter, as the raw-table rules made it. The gateway's /metrics location dials the Service by name through nginx's resolver. The raw-table rules no longer name the exporter's port.
2026-11-27 21:29:38 +01:00
atlas
9a72d07c05 k8s: the controller's listener is a ClusterIP service the host dials by name
The controller's api port was a hostPort on the node, which Pod Security baseline and restricted forbid. It is a ClusterIP Service now, behind a NetworkPolicy that admits only the node. The host's resolver (the hive's dnsmasq) forwards cluster.local to CoreDNS, and the gateway dials the Service by name through nginx's resolver. tcp.hostAddress goes.
2026-11-27 21:29:38 +01:00
atlas
2c1dc695c5 k8s: stt's pod runs in a user namespace of its own 2026-11-27 21:29:38 +01:00
atlas
2259b5f27b k8s: stt's pod gets a network policy: dns and four host ports out, nothing in 2026-11-27 21:29:38 +01:00
atlas
d8baa66666 k8s: the controller pod keeps no volume; the state gate goes 2026-11-27 21:29:38 +01:00
atlas
8b4ae09b45 k8s: the queue's pod mounts the host unit's store in place 2026-11-27 21:29:38 +01:00
atlas
6ac4e9b87d k8s: stt and ci-metrics start without a state gate 2026-11-27 21:29:38 +01:00
atlas
5890e7335b nix: render migrate.json and wrap swarmctl with kubectl 2026-11-27 21:29:38 +01:00
atlas
142acad8b8 a pod with a state volume starts only on a migrated or fresh volume 2026-11-27 21:29:37 +01:00
atlas
dd7de4d1e1 nats: runtime k8s runs the queue and its auth callout as one pod 2026-11-27 21:29:37 +01:00
atlas
53b7f439d1 bao: the queue pod's two jwt roles share one ServiceAccount 2026-11-27 21:29:37 +01:00
atlas
74dcb9b369 docs: the controller's runtime, hostPort hop, listener leaf, state and rev rollout 2026-11-27 21:29:37 +01:00
atlas
b0cc312cc8 module-eval: the controller's runtime, hostPort hop, listener leaf and rev rollout 2026-11-27 21:29:37 +01:00
atlas
d6f0b07ff1 k8s: deploy.swarm-controller.runtime moves the controller between its unit and the cluster 2026-11-27 21:29:37 +01:00
atlas
b5c7240442 k8s: deploy.review-classifier.runtime and deploy.claude-login.runtime move the claude daemons between their containers and the cluster 2026-11-27 21:29:37 +01:00
atlas
cd1fe02b1f k8s: deploy.ci-metrics.runtime moves the CI run poller between its timer and the cluster 2026-11-27 21:29:36 +01:00
atlas
e1c1bad51a k8s: a pod's requests are explicit, so its limits cap and reserve nothing 2026-11-27 21:29:36 +01:00
atlas
49f5e70e3f docs: the speech-to-text service's runtime, limits and cache volume 2026-11-27 21:29:36 +01:00
atlas
68580a8725 k8s: deploy.stt.runtime moves the speech-to-text service between its container and the cluster 2026-11-27 21:29:36 +01:00
atlas
30567ad28f k8s: deploy.notify-router.runtime moves the router between its container and the cluster 2026-11-27 21:29:36 +01:00
atlas
40519f9123 k8s: a pod's public CA files come from a ConfigMap, not a Secret 2026-11-27 21:29:36 +01:00
atlas
7fff98687c k8s: pods log in to the secret store with their ServiceAccount token
The store gets a listener for the pods that asks for no client certificate,
open on the pod network's interfaces only, and a jwt auth mount with one
role per in-cluster service. The rendered pods run under a ServiceAccount
with a projected token in place of their client certificate.
2026-11-27 21:29:36 +01:00
atlas
4ec7513b1b k8s: pod logs and metrics reach the hive collector 2026-11-27 21:29:36 +01:00
atlas
21ea65af1b k8s: pods resolve the swarm names of host-run services to the hive bridge 2026-11-27 21:29:36 +01:00
atlas
53e43a990d k8s: deploy.k8s.enable runs a single-node k3s that holds the service images 2026-11-27 21:29:36 +01:00
atlas
d2acf3080a k8s: render the in-cluster services' manifests from their units
services.hyperhive.k8s.enable renders a Deployment (swarm-controller,
swarm-notify-router) or CronJob (swarm-ci-metrics) per service this host
deploys into system.build.k8sManifests. The renderer reads each evaluated
unit: its environment, LoadCredential ids, state and runtime directories,
ExecStart and timer. Files the unit names are mounted at the same paths, so
the environment carries over as it is. Secrets are referenced by name only.

No unit changes. checks: k8s-manifests-all-local (kubeconform -strict,
offline schemas) and module-eval-k8s; the allLocal fixture turns the
rendering on.
2026-11-27 21:29:36 +01:00
atlas
352af3ea59 swarm-controller: move the deploy concern into its own module
Refs #6897
2026-11-27 21:25:28 +01:00
atlas
05e59c1e8c hive-matrix: the fallocate probe works inside tuwunel's sandbox
Refs #6885
2026-11-27 20:38:14 +01:00
maia
26ac7acb25 deploy: drop the rename shims of controller.links, adminSync.ignoreUsers and otel.scrapeTargets
The three `swarm.*` options moved under their service's deploy namespace on
2026-11-01, so their `mkRenamedOptionModule` shims are past the four-week
window. The `core-toggle` eval case that sets the old names on purpose printed
`Obsolete option ... is used` in every `nix flake check` log, from the shim of
`swarm.otel.scrapeTargets`.

The shims go, and so do the case's settings, assertions and rename-warning
entries for these three. The case keeps the other nine renames. The
`swarm-otel-identity` checks read `scrapeTargets` through the old
`swarm.otel` path, which only the shim provided, so they now read
`deploy.swarm-otel.scrapeTargets`. No config, example or doc names the old
paths.

Closes #6929
2026-11-27 18:14:39 +01:00
atlas
6d0c0dc391 swarm-controller: move the secrets concern into its own module
Refs #6897
2026-11-27 17:35:19 +01:00