package leaderelection
import "k8s.io/dynamic-resource-allocation/leaderelection"
Package leaderelection wraps k8s.io/client-go/tools/leaderelection with a simpler API. It's derived from https://github.com/kubernetes-csi/csi-lib-utils/tree/v0.11.0/leaderelection
Index ¶
- Constants
- func New(clientset kubernetes.Interface, lockName string, runFunc func(ctx context.Context), opts ...Option) *leaderElection
- type Option
- func Context(ctx context.Context) Option
- func HealthCheckTimeout(timeout time.Duration) Option
- func Identity(identity string) Option
- func LeaseDuration(leaseDuration time.Duration) Option
- func Namespace(namespace string) Option
- func RenewDeadline(renewDeadline time.Duration) Option
- func RetryPeriod(retryPeriod time.Duration) Option
- type Server
Constants ¶
const ( // 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" )
Functions ¶
func New ¶
func New(clientset kubernetes.Interface, lockName string, runFunc func(ctx context.Context), opts ...Option) *leaderElection
New constructs a new leader election instance.
Types ¶
type Option ¶
type Option func(l *leaderElection)
Option implements functional options for New.
func Context ¶
func HealthCheckTimeout ¶
func Identity ¶
func LeaseDuration ¶
func Namespace ¶
func RenewDeadline ¶
func RetryPeriod ¶
type Server ¶
Server represents any type that could serve HTTP requests for the leader election health check endpoint.
Source Files ¶
leaderelection.go
- Version
- v0.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 15 packages
- Last checked
- 1 month ago –
Tools for package owners.