leaderelection

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNotLeader constable.Error = "write attempt rejected as client is not leader"

Variables

This section is empty.

Functions

func New

New returns a client that has a leader election middleware injected into it. This middleware will prevent all non-read requests to the Kubernetes API when the current process does not hold the leader election lock. Unlike normal leader election where the process blocks until it acquires the lock, this middleware approach lets the process run as normal for all read requests. Another difference is that if the process acquires the lock and then loses it (i.e. a failed renewal), it will not exit (i.e. restart). Instead, it will simply attempt to acquire the lock again.

The returned function is blocking and will run the leader election polling logic and will coordinate lease release with the input controller starter function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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