master.yaml runs several stateless master replicas that share scheduler state
through a separate etcd cluster.
Before applying it:
- Replace
DATA_DIRwith the shared object-store prefix used by rollout workers. - Set object-store credentials and
WORKER_ENDPOINTSfor your environment. - Replace the example image name and
UI_DIRwith paths from the published master image. - Replace
ETCD_ENDPOINTSand create the referenced auth/TLS Secrets. Remove the auth variables or TLS volume/configuration when the application etcd cluster does not use them.
Scheduler state lives entirely in etcd, so the master is stateless and runs with multiple replicas. Use a separate application etcd cluster, not the Kubernetes control-plane etcd. Each etcd member owns its own persistent volume; master pods have no PVC.
Task enqueue de-duplication, queued-to-running claims, and per-experiment Compact/IndexId locks use etcd transactions. Claims and locks are attached to renewed leases. If a master disappears, another replica requeues the task after the lease expires. Execution is at-least-once, so task implementations must remain idempotent across crash recovery.
The _stats.rollout.lance table remains in DATA_DIR. etcd coordinates its
single-writer sections, while readers reload the latest Lance manifest so every
master replica sees current stats.
Two periodic sweeps run on the master and feed the shared scheduler queue:
- Compaction (
COMPACTION_INTERVAL_SECS,MIN_FRAGMENTS) rewrites an experiment's base-table fragments locally on the master. - WAL merge (
MERGE_WAL_INTERVAL_SECS,MERGE_WAL_MIN_GENERATIONS) enqueues aMergeWaltask for every experiment whose pending MemWAL generation count (from the periodically-scanned stats table) crosses the threshold. The task fans out to everyWORKER_ENDPOINTSworker, each of which folds its own shard. The master cannot merge a shard it does not own without fencing the live writer, so the merge itself always runs on the owning worker. Set the interval to0to disable it; the manual "Merge WAL" / "Optimize" UI actions still work.