Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg *LeaderElectionConfig, onStart, onStop func()) (*leaderelection.LeaderElector, error)
New creates a new leader election manager
func Run ¶
func Run(elector *leaderelection.LeaderElector, ctx context.Context)
Run starts the leader election process
Types ¶
type LeaderElectionConfig ¶
type LeaderElectionConfig struct { LeaseLockName string // Name of the lease lock LeaseLockNamespace string // Namespace for the lease lock Identity string // Unique identity for the candidate LeaseDuration time.Duration // Duration that non-leader candidates will wait to force acquire leadership RenewDeadline time.Duration // Duration that the acting master will retry refreshing leadership before giving up RetryPeriod time.Duration // Duration the LeaderElector clients should wait between tries of actions }
LeaderElectionConfig represents the configuration for leader election
Click to show internal directories.
Click to hide internal directories.