Skip to main content

Module lease

Module lease 

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

Leader election over a coordination.k8s.io/v1 Lease: every replica serves traffic, only the holder writes status and Services. The holder renews every RENEW; another replica takes over once a renewal is older than the lease’s duration. Updates carry the Lease’s resourceVersion, so two replicas can’t both win.

Structs§

LeaseSettings

Enums§

Decision
What a replica should do with the Lease as it is now.

Constants§

DURATION
How long a holder’s renewal counts.
RENEW
How often the holder renews (and others check).

Functions§

decide
run
Hold or follow the Lease forever; leader says which, gained fires when this replica becomes the leader (so it can reconcile at once).