Each service’s three replicas form their own Raft ring on port 7480. Curator connects to SunLink on 127.0.0.1:2181 and runs its standard recipes.
Architecture
- Each service’s three replicas form one Raft ring (Apache Ratis) on port 7480 over mTLS. There is no ring spanning services.
- A ZooKeeper-protocol endpoint listens on
127.0.0.1:2181for the in-process Curator and other local ZooKeeper clients. - ZooKeeper semantics (znodes, sessions, watches,
multi) are mapped onto the Ratis state machine. - Writes are linearizable, and reads are served from the leader.
Ports
| Port | Bind | Purpose |
|---|---|---|
| 2181 | 127.0.0.1 | ZooKeeper protocol for the in-process Curator and other local ZK clients |
| 7480 | pod IP, mTLS | Ratis ring traffic between the service’s replicas |
Configuration
SunLink reads no environment variables itself. The embedding service passes a SunLinkConfig:
| Field | Meaning |
|---|---|
nodeId | e.g. bubbl-1, from the StatefulSet pod name |
peers | From <SVC>_SUNLINK_CLUSTER or headless-service DNS |
dataDir | Raft log and snapshots (on the PVC) |
clientPort | Default 2181 |
ringPort | Default 7480 |
tls | cert-manager keystore and truststore |
sessionTimeout | Default 10 seconds |
Public Kotlin API
| Member | Purpose |
|---|---|
start() | Start the node and join the ring |
curator | A CuratorFramework connected to 127.0.0.1:2181 |
leaderLatch(path) | A LeaderLatch, e.g. on /<svc>/leader |
withLock(path, timeout, block) | Run a block under an InterProcessMutex |
members() | Live replicas, from ephemeral nodes under /<svc>/members |
onMembershipChange(listener) | Be told when replicas join or leave |
isLeader | Whether this replica currently leads |
Scope
Out of scope: ACLs beyond world:anyone on localhost, quotas, and the four-letter-word admin commands.