leader

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Become

func Become(ctx context.Context) error

Become ensures that the current pod is the leader within its namespace. If run outside a cluster, it will skip leader election and return nil. It continuously tries to create a ConfigMap with the provided name and the current pod set as the owner reference. Only one can exist at a time with the same name, so the pod that successfully creates the ConfigMap is the leader. Upon termination of that pod, the garbage collector will delete the ConfigMap, enabling a different pod to become the leader.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL