Documentation
¶
Overview ¶
Package leaderelection contains the leader election mechanism.
Index ¶
- func Blocking(ctx context.Context, rc *rest.Config, eb record.EventBroadcaster, opts *Opts) (bool, error)
- func Init(opts *Opts, rc *rest.Config, eb record.EventBroadcaster) (*leaderelection.LeaderElector, error)
- func IsLeader() bool
- func LabelerOnElection(ctx context.Context, mgr manager.Manager, info *PodInfo)
- func Run(ctx context.Context, leaderelector *leaderelection.LeaderElector)
- type Opts
- type PodInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Blocking ¶
func Blocking(ctx context.Context, rc *rest.Config, eb record.EventBroadcaster, opts *Opts) (bool, error)
Blocking runs the blocking leader election.
func Init ¶
func Init(opts *Opts, rc *rest.Config, eb record.EventBroadcaster) (*leaderelection.LeaderElector, error)
Init initializes the leader election mechanism.
func LabelerOnElection ¶
LabelerOnElection is a function that labels the leader pod with the leader label.
func Run ¶
func Run(ctx context.Context, leaderelector *leaderelection.LeaderElector)
Run run the leader election mechanism.
Types ¶
Click to show internal directories.
Click to hide internal directories.