Watch
0
0
Fork
You've already forked hyperhive
0
Commit graph hyperhive/nix/module-eval
Author SHA1 Message Date
atlas
3213bfba7a 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 18:07:59 +01:00
atlas
2116ad28e1 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 18:07:59 +01:00
maia
5898e508e5 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 18:07:59 +01:00
atlas
c7c82a6b02 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 18:07:59 +01:00
atlas
087c51eef6 full-setup and the host swarmctl reach the controller as a pod, not through a host socket 2026-11-27 18:07:59 +01:00
atlas
052b559196 require k8s: swarm services with a pod run in the cluster only 2026-11-27 18:07:59 +01:00
atlas
6be1b59ffc let a second machine join the main node's k3s and run pods from images only the main node holds 2026-11-27 18:07:59 +01:00
atlas
79c06cdcb0 pin queue and poller state to per-service node labels instead of the hostname 2026-11-27 18:07:59 +01:00
maia
6acf1012cb 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 18:07:59 +01:00
maia
b46c95f910 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 18:07:59 +01:00
atlas
077f6f707d remove swarmctl migrate, migrate.json and the migrate docs 2026-11-27 18:07:59 +01:00
atlas
d9023217fc 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 18:07:59 +01:00
atlas
796fd6201f 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 18:07:59 +01:00
atlas
c2d57df7f5 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 18:07:59 +01:00
atlas
ead0ef8719 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 18:07:59 +01:00
atlas
8cd6ae3037 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 18:07:59 +01:00
atlas
ada980f35c k8s: stt's pod runs in a user namespace of its own 2026-11-27 18:07:59 +01:00
atlas
6051a83044 k8s: stt's pod gets a network policy: dns and four host ports out, nothing in 2026-11-27 18:07:59 +01:00
atlas
513be8f7d0 k8s: the controller pod keeps no volume; the state gate goes 2026-11-27 18:07:59 +01:00
atlas
b69f8c1de0 k8s: the queue's pod mounts the host unit's store in place 2026-11-27 18:07:59 +01:00
atlas
2232acd056 k8s: stt and ci-metrics start without a state gate 2026-11-27 18:07:59 +01:00
atlas
5779bc5719 nix: render migrate.json and wrap swarmctl with kubectl 2026-11-27 18:07:59 +01:00
atlas
b95e685a99 module-eval: the state gate is every stateful pod's first init container 2026-11-27 18:07:59 +01:00
atlas
079ff14fd6 module-eval: the queue's pod, jwt roles, host units, exposure rules and store guard 2026-11-27 18:07:59 +01:00
atlas
0b96c03134 module-eval: the controller's runtime, hostPort hop, listener leaf and rev rollout 2026-11-27 18:07:59 +01:00
atlas
b19ef152b0 module-eval: the claude daemons' units, host-mode containers, pods, jwt roles and refusals 2026-11-27 18:07:59 +01:00
atlas
6512aaa3e9 k8s: deploy.ci-metrics.runtime moves the CI run poller between its timer and the cluster 2026-11-27 18:07:59 +01:00
atlas
49406498a7 k8s: a pod's requests are explicit, so its limits cap and reserve nothing 2026-11-27 18:07:59 +01:00
atlas
be70b3189e k8s: deploy.stt.runtime moves the speech-to-text service between its container and the cluster 2026-11-27 18:07:59 +01:00
atlas
50dc13d61b k8s: deploy.notify-router.runtime moves the router between its container and the cluster 2026-11-27 18:07:59 +01:00
atlas
b44cbea79d k8s: a pod's public CA files come from a ConfigMap, not a Secret 2026-11-27 18:07:59 +01:00
atlas
d1554def7a 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 18:07:59 +01:00
atlas
dbcc47573e k8s: pod logs and metrics reach the hive collector 2026-11-27 18:07:59 +01:00
atlas
cb54519be8 k8s: pods resolve the swarm names of host-run services to the hive bridge 2026-11-27 18:07:59 +01:00
atlas
1f61be83e6 k8s: deploy.k8s.enable runs a single-node k3s that holds the service images 2026-11-27 18:07:59 +01:00
atlas
40c5b3f5da 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 18:07:59 +01:00
atlas
7c7c94d184 hive-matrix: turn off tuwunel's log preallocation on btrfs and zfs
Refs #6885
2026-11-27 17:35:04 +01:00
atlas
cd8feedf73 swarm-controller: move the observability concern into its own module
Refs #6897
2026-11-27 14:21:35 +01:00
atlas
237cdaffaa swarm-controller: move the review concern into its own module
Refs #6897
2026-11-27 12:17:26 +01:00
maia
ecfc21b962 egress: let every agent reach the swarm's own endpoints under forward reject
With the egress intercept on, the forward chain rejects what `agent_allow`
does not hold, and `agent_allow` only held an agent's ssh connections. An
agent whose secret store, queue, logs or metrics endpoint is not on the
bridge was refused, so no agent started on a hive away from the swarm host.

hive-c0re's egress worker now also renders a `* <ipv4> <port>` line for each
endpoint URL it hands to agents (HIVE_AGENT_BAO_ADDR, HIVE_AGENT_LOGS_QUERY_URL,
HIVE_AGENT_METRICS_URL, HIVE_AGENT_NATS_URL), resolved like the ssh hosts.
`hive-priv egress-pin` expands a `*` line to the MAC of every agent port. An
older hive-priv skips the line, as it skips any unknown name.

Closes #6902
2026-11-27 11:45:43 +01:00
iris
928fe568dd grafana: make the hive degraded alert name the critical warning
The alert read the per-hive degraded gauge, so it could not say which warning
raised it and sent the operator to a second alert. It now reads the critical
warning series, one instance per kind, and the summary names the kind. The
docs and the module-eval check follow. The message text is not in the alert,
only in the hive-c0re log.
2026-11-25 18:51:10 +01:00
maia
912b2d9570 swarm-otel: a timer starts the receiver-socket check again while it is failed
swarm-otel-sockets probes once at activation. On a fresh swarm the
collector opens its sockets only after authelia answers, which is after
the operator unseals the store, so the probe failed and stayed failed
after ingest worked: the only red unit on the swarm.

swarm-otel-sockets-recheck.timer now starts it again each minute, and
only while it is failed (an ExecCondition on systemctl is-failed), with
a restart that does not block. The check itself gets no Restart: a
oneshot's start job stays pending through an automatic restart, so a
switch would wait on it for as long as the collector is down, and the
failed check is what the switch reports. full-setup waits for the check
to be active after the collector has recovered, and the module-eval case
pins the timer, the condition and the absence of a Restart.

Closes #6836
2026-11-24 16:41:04 +01:00
atlas
cd040afa0e swarmctl login: find the sso provider from the gateway's published metadata 2026-11-23 23:19:45 +01:00
maia
dad288d555 swarm-otel, swarm-grafana: a delivery unit fails on no value yet
The collector's and Grafana's OIDC delivery units exited 0 when the store
held no value, so systemd did not retry them. On a fresh swarm authelia's
mint writes the secret about 30 s after the first read, and only the
refresh timer, ten minutes on, read it again. Both units now exit 75, and
the store retry they already carry asks every 30 s until the mint lands.

Closes #6790
2026-11-23 12:43:37 +01:00
atlas
480855dfaf swarm-otel: scrape the authenticated targets only once the collector has its client secret
An empty secret file made the prometheus receiver request a token for each published target every scrape; authelia's per-address limit then refused every client behind that address. Without a secret the collector starts on the config minus those jobs. full-setup asserts the limiter never fired.
2026-11-23 12:28:12 +01:00
iris
1a31a4cd5a swarm: set an agent's config repo avatar from its icon
The agent module exposes the PNG nix renders from the agent's icon as the
read-only option services.hyperhive.agent.iconPng, which the forge and matrix
avatar syncs now share. When the builder reads an icon it builds that one
attribute with nix build and sends the file, base64, next to the SVG in the
meta build reply, so the builder runs no renderer of its own.

After recording the icon, the controller sets the avatar of
agent-configs/<agent> from the PNG as the forge admin, removes the avatar when
the icon is removed, and leaves it alone when the builder sent no PNG. A marker
per repo holds the image's fingerprint, so a build whose icon did not change
makes no forge call; a forge that refuses the avatar does not fail the build.
An old builder sends no PNG, so it changes nothing.
2026-11-23 10:11:16 +01:00
atlas
90a1e523fb swarm-otel: delete a sender-set sender and hive from datapoints and log records 2026-11-23 08:23:01 +01:00
atlas
c529bab9ea module-eval: grafana and swarm-otel cases follow the sender stamp 2026-11-23 00:48:56 +01:00
atlas
22c4d16a20 swarm-otel: stamp sender from the authenticated client id, not a hive 2026-11-23 00:48:56 +01:00
maia
6e2abcb0a5 module-eval: the forge no longer shares the host netns
Two service containers share it now, bao and the queue; fourteen have a netns of their own.
2026-11-22 20:52:35 +01:00