Skip to main content

Module controller

Module controller 

Source
Available on crate feature gateway-api only.
Expand description

The controller loop: one watcher per kind feeding a shared store, a debounced reconcile that runs translate over a snapshot of those stores, hands the result to the data plane, and writes the status that changed.

Status is written with a JSON merge patch on /status. For routes, status.parents is one list shared with other controllers: rws replaces only its own entries (by controllerName) and sends the object’s resourceVersion, so a concurrent write by someone else makes the API server refuse ours (409) rather than lose theirs; the next reconcile retries from fresh state.

Structs§

Options
What the controller needs besides the cluster.
Stores
The watched stores.

Constants§

DEBOUNCE
How long changes are gathered before a reconcile.
RESYNC
A reconcile at least this often, changes or not (status drift, a lost event).

Functions§

merge_parents
Other controllers’ entries as they are, then ours.
reconcile
One pass: translate, hand the configuration over, write changed status.
run
Reconcile on every change, when this replica becomes the leader, and every RESYNC, forever.
start_watches
Start watching everything (rws’s own pods by services’ namespace and selector); returns the stores and the change signal.