Expand description
Daemon-level cluster mode selection.
Defines how a ZLayer daemon participates in (or doesn’t) cluster
membership. This is the top-level config the daemon reads at startup
to decide which Cluster trait implementation to construct.
For the wire-level join/membership DTOs see crate::api::cluster.
Structs§
- Adaptive
TtlConfig - Adaptive-TTL heartbeat configuration. Mirrors Nomad’s design: the leader caps cluster-wide heartbeat rate to a constant by stretching individual workers’ TTLs as the cluster grows.
- Cluster
Container Summary - One container’s summary for cluster-wide listing/aggregation, tagged with the
node it runs on. Wire type shared by the agent (builds the local view), the
scheduler’s
Clusterfan-out, and the API (GET /internal/services/{svc}/state+list_containers), so the leader can report replicas placed on remote nodes (distributed scaling). - Internal
Scale Request - Wire-format scale request fanned out by the cluster’s leader to each node that gets assigned at least one replica of a service.
- Node
Service State - A single node’s view of one service: how many replicas it runs locally,
whether they’re healthy there, and their containers. The leader aggregates
one of these per node (its own local view + remote views fetched via the
Clusterfan-out) to compute cluster-wide replica count, health, and thepscontainer listing for distributed services. - Raft
Peer - A raft peer’s identity and reachability.
- Scale
Assignment - One role-group entry within an
InternalScaleRequest. Phase 2 ships this; Phase 1 uses the legacyreplicasfield only. - Static
Peer - A static-cluster peer’s identity, reachability, and labels.
- Worker
Container Status - Worker
Lease - A worker lease in the leader’s directory — drives liveness.
- Worker
Poll Request - Long-poll request for new assignments. Server waits up to ~30s for
a revision newer than
last_revision, then returns the current assignment set (which may be empty). - Worker
Poll Response - Response to a long-poll: zero or more assignment events newer than
the worker’s
last_revision. - Worker
Profile - Worker profile — published to the cluster directory on registration.
- Worker
Register Request - Bootstrap join request from a new worker node.
- Worker
Register Response - Successful registration response.
- Worker
Resource Usage - Worker
Status Ack - Ack for a
WorkerStatusReport. Carries the next-TTL so the worker can adapt its heartbeat cadence. - Worker
Status Report - Periodic status report from worker → control plane.
Enums§
- Cluster
Mode - How the daemon participates in (or doesn’t) cluster membership.
- Worker
Assignment Event - One change to a worker’s assignment set.
- Worker
Tier Role - What role this node plays in a worker-tier cluster.