leaderelection

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 17 Imported by: 61

Documentation

Index

Constants

View Source
const (
	DefaultHealthCheckTimeout = 20 * time.Second

	// HealthCheckerAddress is the address at which the leader election health
	// checker reports status.
	// The caller sidecar should document this address in appropriate flag
	// descriptions.
	HealthCheckerAddress = "/healthz/leader-election"
)

Variables

This section is empty.

Functions

func NewLeaderElection

func NewLeaderElection(clientset kubernetes.Interface, lockName string, runFunc func(ctx context.Context)) *leaderElection

NewLeaderElection returns the default & preferred leader election type

func NewLeaderElectionWithLeases

func NewLeaderElectionWithLeases(clientset kubernetes.Interface, lockName string, runFunc func(ctx context.Context)) *leaderElection

NewLeaderElectionWithLeases returns an implementation of leader election using Leases

func RunWithLeaderElection added in v0.23.0

func RunWithLeaderElection(
	ctx context.Context,
	config *rest.Config,
	opts standardflags.SidecarConfiguration,
	run func(context.Context),
	driverName string,
	mux *http.ServeMux,
	releaseOnExit bool)

Types

type Server added in v0.9.0

type Server interface {
	Handle(pattern string, handler http.Handler)
}

Server represents any type that could serve HTTP requests for the leader election health check endpoint.

Jump to

Keyboard shortcuts

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