Watch
0
0
Fork
You've already forked hyperhive
0
Commit graph

7,078 commits

Author SHA1 Message Date
atlas
87d79ca4f0 swarmctl, vm tests: wait for the store's active node after an unseal
An unsealed store has no active node for a few seconds and refuses writes
with "local node not active". swarmctl bao grant-bootstrap now repeats
bao policy list and bao policy write every second, up to a minute, while
the store answers that; setup.md says so. The full-setup and semi-spread
tests wait for bao policy list with the root token before the bootstrap.

full-setup.py: when create_agent gives up it also prints the controller
pod's logs, the pod list and the swarm builder's journal. A run that
failed with no archetype "reviewer" for 13 minutes left no controller or
builder output to read.
2026-11-27 12:00:49 +01:00
atlas
77509463b1 k8s: the ca-trust publisher no longer holds multi-user.target while it waits for the setup 2026-11-27 12:00:49 +01:00
atlas
87567f427e 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 11:47:16 +01:00
atlas
7ad74b494f 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 11:47:16 +01:00
maia
02e0aab3b6 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 11:47:16 +01:00
atlas
a4e44645a0 k8s-services: the seeded log record is found by a word of its message, and a stuck seed fails its unit 2026-11-27 11:47:16 +01:00
atlas
71b2e9310c 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 11:47:16 +01:00
atlas
279f97e5ca swarmctl: drop the controller socket target, the host has no socket to reach 2026-11-27 11:47:16 +01:00
atlas
64d340e385 full-setup and the host swarmctl reach the controller as a pod, not through a host socket 2026-11-27 11:47:16 +01:00
atlas
67bf51809a k8s vm tests: create the agent netns before k3s starts a pod, and delete pods strictly again 2026-11-27 11:47:16 +01:00
atlas
032aa2e59a k8s-join: wait through a pull from a peer that fails first, and print the registry state when it keeps failing 2026-11-27 11:47:16 +01:00
atlas
2e1f037f25 require k8s: swarm services with a pod run in the cluster only 2026-11-27 11:47:16 +01:00
atlas
7819ed2dbd let a second machine join the main node's k3s and run pods from images only the main node holds 2026-11-27 11:47:16 +01:00
atlas
aab13d065f k8s-nats-switch: set the default namespace again after a switch restarts k3s 2026-11-27 11:47:16 +01:00
atlas
ff2bdea78d pin queue and poller state to per-service node labels instead of the hostname 2026-11-27 11:47:16 +01:00
maia
cafbf3262f node.md: keep the punctuation outside quotes out of the new sentence 2026-11-27 11:47:16 +01:00
maia
02771eab84 swarmctl setup status: the comment names the marker file, not the journal 2026-11-27 11:47:16 +01:00
maia
8464acf883 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 11:47:16 +01:00
maia
96430cf43c docs: turning the node on restarts the store, so unseal before the re-grant
node.md named the second grant-bootstrap and nothing before it. The
first activation with deploy.k8s.enable adds a pod listener to the
store's configuration, which restarts container@swarm-bao. A shamir
store comes back sealed, the units that read it fail, and
grant-bootstrap cannot log in until an operator unseals it. A pkcs11
store unseals itself.

node.md now has the order for a swarm that already runs: unseal on a
shamir store, then grant-bootstrap once, then restart the policy units,
as setup.md does. Only node.md changes.

Closes #6844
2026-11-27 11:47:16 +01:00
maia
f658b2c770 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 11:47:16 +01:00
atlas
f89d289a9f remove swarmctl migrate, migrate.json and the migrate docs 2026-11-27 11:47:16 +01:00
atlas
58e59be65e vm-tests: k8s-bao-login expects the roles the module names
The test listed three jwt roles by hand, and the store has eight since the queue, stt, the review classifier and the claude minter joined, so it failed at the role assertion before it reached any pod. The list is now the module's own k8sPrincipals, sorted.
2026-11-27 11:47:16 +01:00
maia
c909777b63 k8s VM tests: wait for the store's active node after the unseal
The tests waited on `bao status`, which answers once the node is
unsealed and before raft has elected it, so the first policy write raced
the election and failed with "local node not active but active cluster
node not found". `unseal_bao` unseals and then waits for sys/leader to
say the node is the leader; the four tests that bootstrap the store use
it at both unseal sites.

Closes #6807
2026-11-27 11:47:16 +01:00
atlas
51565fdba6 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 11:47:16 +01:00
atlas
9752f30f36 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 11:47:16 +01:00
atlas
0d857b8ae1 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 11:47:15 +01:00
atlas
7ef9444e42 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 11:46:56 +01:00
atlas
3cf89f25f1 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 11:46:56 +01:00
atlas
4e60183bfa k8s: stt's pod runs in a user namespace of its own 2026-11-27 11:46:56 +01:00
atlas
02cc38d89e k8s: stt's pod gets a network policy: dns and four host ports out, nothing in 2026-11-27 11:46:56 +01:00
atlas
4ea3b0e10d k8s: the controller pod keeps no volume; the state gate goes 2026-11-27 11:46:56 +01:00
atlas
140ee7f38a k8s: the queue's pod mounts the host unit's store in place 2026-11-27 11:46:56 +01:00
atlas
a793df9708 k8s: stt and ci-metrics start without a state gate 2026-11-27 11:46:56 +01:00
atlas
772435504f docs: migrate status reads the gate from the pod's status 2026-11-27 11:46:56 +01:00
atlas
e6326abd7e vm-tests: migrate status reports the state gate's answers 2026-11-27 11:46:56 +01:00
atlas
ee235e480f nix: render migrate.json and wrap swarmctl with kubectl 2026-11-27 11:46:56 +01:00
atlas
490f6fbdba swarmctl: migrate status reads where each service's move stands 2026-11-27 11:46:56 +01:00
atlas
c8993bc915 docs: say what the nats pod does and doesn't isolate 2026-11-27 11:46:56 +01:00
atlas
65f7a55967 docs: the start gate describes what the pod runs 2026-11-27 11:46:56 +01:00
atlas
360454958a vm-tests: the state gate refuses an empty volume until the marker is written 2026-11-27 11:46:56 +01:00
atlas
10c22d9ffa module-eval: the state gate is every stateful pod's first init container 2026-11-27 11:46:56 +01:00
atlas
394a08d885 a pod with a state volume starts only on a migrated or fresh volume 2026-11-27 11:46:56 +01:00
atlas
777a0fe53c docs: the queue in the cluster 2026-11-27 11:46:56 +01:00
atlas
3e1d3d0003 vm-tests: k8s-nats-switch moves the queue between its container and the cluster 2026-11-27 11:46:56 +01:00
atlas
580fdaaacb module-eval: the queue's pod, jwt roles, host units, exposure rules and store guard 2026-11-27 11:46:56 +01:00
atlas
a2db26d344 nats: runtime k8s runs the queue and its auth callout as one pod 2026-11-27 11:46:56 +01:00
atlas
1c8798a3ca bao: the queue pod's two jwt roles share one ServiceAccount 2026-11-27 11:46:56 +01:00
atlas
e7334ad98e docs: the controller's runtime, hostPort hop, listener leaf, state and rev rollout 2026-11-27 11:46:56 +01:00
atlas
713f866030 vm-tests: k8s-controller-switch moves the controller between its unit and the cluster 2026-11-27 11:46:56 +01:00
atlas
8d1b7da541 module-eval: the controller's runtime, hostPort hop, listener leaf and rev rollout 2026-11-27 11:46:56 +01:00