Skip to content

Service roles and leader election

The control plane separates request serving from desired-state reconciliation. API replicas can scale horizontally, while a controller lease gives one replica authority to advance shared records during each bounded cycle.

Runtime roles

flowchart LR
  subgraph CP["CONTROL-PLANE REPLICAS"]
    direction TB
    API1["API server"]
    API2["API server"]
    CTRL1["Controller candidate"]
    CTRL2["Controller candidate"]
  end
  LEASE[("Controller lease")]
  STATE[("Desired state")]
  API1 --> STATE
  API2 --> STATE
  CTRL1 -->|"claim or renew"| LEASE
  CTRL2 -->|"claim or renew"| LEASE
  LEASE -->|"one holder"| STATE

all runs request serving and controller reconciliation in one process. controller runs the reconciliation cycle. api, scheduler and event-ingestor are recognised deployment role values, while the controller manager returns service-role-skip for those roles.

Project runtime placement is a control-plane scheduling operation invoked by the project deployment lifecycle. The deployed kernel owns Application Run scheduling through its Application ABI.

Leadership state

The controller lease records its name, owner instance and expiry. A controller candidate claims or renews it before starting a cycle. A contender returns not-leader until it holds the lease. When a holder stops renewing, the lease expires and another candidate can continue from recorded state.

Leadership status reports the service role, instance identity, lease name, lease lifetime and holder result. Assignment leases and fences remain separate records because they govern work owned by data-plane nodes, not control-plane controller leadership.

See The controller manager for the cycle and HA topology for replica placement.