require k8s: swarm services with a pod run in the cluster only
This commit is contained in:
parent
7819ed2dbd
commit
2e1f037f25
1 changed files with 1044 additions and 3125 deletions
|
|
@ -1,11 +1,14 @@
|
|||
# The cluster node
|
||||
|
||||
`services.hyperhive.deploy.k8s.enable` (default `false`) makes the host run a
|
||||
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 no service's objects applied. Other machines can
|
||||
[join it](#joining-nodes) and run the services' pods; hyperhive runs no
|
||||
`services.hyperhive.deploy.k8s.enable` makes the host run the main node of a k3s
|
||||
cluster for the swarm services that run in the cluster. It defaults on where the
|
||||
host enables one of them (`deploy.notify-router`, `stt`, `ci-metrics`,
|
||||
`review-classifier`, `claude-login`, `nats` or `swarm-controller`), which
|
||||
`services.hyperhive.deploy.singleHostSwarm` and
|
||||
`services.hyperhive.deploy.allSwarmServices` do, so the all-local host gets the
|
||||
cluster with its services in it and no option set. Setting it to `false` on such
|
||||
a host fails the evaluation, naming the option and the services. Other machines
|
||||
can [join it](#joining-nodes) and run the services' pods; hyperhive runs no
|
||||
cluster of its own beyond that one main node, and it replicates no service.
|
||||
|
||||
## What the host gets
|
||||
|
|
@ -43,11 +46,12 @@ cluster of its own beyond that one main node, and it replicates no service.
|
|||
|
||||
## What it leaves alone
|
||||
|
||||
The cluster starts with no hyperhive workload. Each service keeps running as
|
||||
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 its `runtime` is `"k8s"` ([the runtime switch](runtime.md)).
|
||||
The cluster holds the workload of the swarm services the host enables, and no
|
||||
other: [the runtime module](runtime.md) applies their manifests, and each runs
|
||||
there and nowhere else, because two copies of `swarm-notify-router`,
|
||||
`swarm-ci-metrics` or `swarm-controller` would share one queue consumer, one
|
||||
cursor or one swarm. A host that enables none has a cluster with no hyperhive
|
||||
workload.
|
||||
|
||||
With the option off, the host's configuration is the one it has without the
|
||||
module.
|
||||
|
|
@ -59,8 +63,8 @@ says so with a label. The module sets the labels
|
|||
(`services.hyperhive.deploy.k8s.nodeLabels`, passed to `services.k3s.nodeLabel`):
|
||||
|
||||
- `hyperhive.darkest.space/state-<service>=true`, one per service whose data
|
||||
the cluster keeps. Today that's `nats`, when `deploy.nats.runtime` is
|
||||
`"k8s"`, and `ci-metrics`, when `deploy.ci-metrics.runtime` is `"k8s"`. The
|
||||
the cluster keeps. Today that's `nats`, when `deploy.nats.enable` is on, and `ci-metrics`, when
|
||||
`deploy.ci-metrics.enable` is on. The
|
||||
service's static local volume has a `nodeAffinity` on the label, and its pod a
|
||||
`nodeSelector` on it, so a node without the label can't run the pod and shows
|
||||
as no match instead of a volume that can't bind. One label per service, so
|
||||
|
|
@ -257,7 +261,7 @@ once more.
|
|||
|
||||
### Turning the node on for a swarm that already runs
|
||||
|
||||
The first activation with `deploy.k8s.enable` restarts the store's container,
|
||||
The first activation with the node on restarts the store's container,
|
||||
`container@swarm-bao`. The node adds a `pod` listener to the store's
|
||||
configuration, and a changed container configuration restarts the container.
|
||||
What comes next depends on the store's seal:
|
||||
|
|
|
|||
Loading…
Reference in a new issue