Skip to main content

Module cluster

Module cluster 

Source
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§

AdaptiveTtlConfig
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.
ClusterContainerSummary
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 Cluster fan-out, and the API (GET /internal/services/{svc}/state + list_containers), so the leader can report replicas placed on remote nodes (distributed scaling).
InternalScaleRequest
Wire-format scale request fanned out by the cluster’s leader to each node that gets assigned at least one replica of a service.
NodeServiceState
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 Cluster fan-out) to compute cluster-wide replica count, health, and the ps container listing for distributed services.
RaftPeer
A raft peer’s identity and reachability.
ScaleAssignment
One role-group entry within an InternalScaleRequest. Phase 2 ships this; Phase 1 uses the legacy replicas field only.
StaticPeer
A static-cluster peer’s identity, reachability, and labels.
WorkerContainerStatus
WorkerLease
A worker lease in the leader’s directory — drives liveness.
WorkerPollRequest
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).
WorkerPollResponse
Response to a long-poll: zero or more assignment events newer than the worker’s last_revision.
WorkerProfile
Worker profile — published to the cluster directory on registration.
WorkerRegisterRequest
Bootstrap join request from a new worker node.
WorkerRegisterResponse
Successful registration response.
WorkerResourceUsage
WorkerStatusAck
Ack for a WorkerStatusReport. Carries the next-TTL so the worker can adapt its heartbeat cadence.
WorkerStatusReport
Periodic status report from worker → control plane.

Enums§

ClusterMode
How the daemon participates in (or doesn’t) cluster membership.
WorkerAssignmentEvent
One change to a worker’s assignment set.
WorkerTierRole
What role this node plays in a worker-tier cluster.