Watch
0
0
Fork
You've already forked hyperhive
0

k8s: pods resolve the swarm names of host-run services to the hive bridge

This commit is contained in:
atlas 2026-11-21 13:13:29 +01:00 • committed by maia
commit 21ea65af1b

View file

@ -4,7 +4,7 @@
single-node k3s server for the swarm services that run in the cluster. It's
the Kubernetes counterpart of `services.hyperhive.deploy.singleHostSwarm`: set
it on the host that runs the swarm's services, and the cluster comes up with the
service images loaded and nothing applied.
service images loaded and no service's objects applied.
## What the host gets
@ -32,7 +32,7 @@ service images loaded and nothing applied.
## What it leaves alone
The cluster starts with no hyperhive workload. Each service keeps running as
its systemd unit, and nothing applies the manifests: two copies of
its systemd unit, and nothing applies the services' manifests: two copies of
`swarm-notify-router`, `swarm-ci-metrics` or `swarm-controller` would share one
queue consumer, one cursor or one swarm. A service's objects go into the
cluster when that service moves in (see [`swarmctl migrate`](migrate.md)).
@ -40,13 +40,30 @@ cluster when that service moves in (see [`swarmctl migrate`](migrate.md)).
With the option off, the host's configuration is the one it has without the
module.
## Reaching host-run services
A pod reaches a service that runs on the host by the service's swarm name. The
cluster's CoreDNS answers each such name with the hive bridge's address
(`network.bridgeIp`), the address the agents' resolver gives, so a pod reaches
the same listeners an agent does: the gateway's vhosts, the secret store's TLS
port, the queue and the hive's OTLP collector. The names are the hive domain
and every name a host module contributes to `gateway.localNames` because the
host runs that service. `services.hyperhive.deploy.k8s.hostServices` is that
table, and it holds the only host address the cluster knows.
The node applies the table to k3s as a `coredns-custom` ConfigMap, which is a
node object and not a service manifest. A name outside the table, and every
cluster name, resolves as before. A host without the hive bridge has no
address to answer with, so it gets no ConfigMap.
The firewall trusts the pod network's interfaces, so a pod reaches
these listeners without a firewall rule per port. Each service still
authenticates its callers: the secret store refuses a connection without a
client certificate.
## Validation
`module-eval-k8s` compares an all-local host with the option on against the
same host with it off. The off host has no k3s, no trusted interface and no
image list; the on host adds the k3s unit and nothing else. The VM test
`k8s-node` boots a node through the module, and asserts that the node is Ready,
that containerd holds every image, that the cluster has no hyperhive
workload, and that the node and the hive bridge hold addresses from
different ranges. The module-eval also checks that overlapping ranges fail the
evaluation.
same host with it off, and checks the address ranges and the CoreDNS
ConfigMap. The VM test `k8s-node` boots a node through the module and runs a
pod against it.