leaderelection

package
v0.0.0-...-b8da2f3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LeaseHijacker

func LeaseHijacker(ctx context.Context, config *rest.Config, namespace string, name string) resourcelock.Interface

LeaseHijacker implements lease stealing to accelerate development workflows. When starting your controller manager, your local process will forcibly become leader. This is useful when developing locally against a cluster which already has a controller running in it

TODO: migrate to https://kubernetes.io/docs/concepts/cluster-administration/coordinated-leader-election/ when it's past alpha.

Include this in your controller manager as follows: ``` controllerruntime.NewManager(..., controllerruntime.Options{

// Used if HIJACK_LEASE is not set LeaderElectionID: name, LeaderElectionNamespace: "namespace",

// Used if HIJACK_LEASE=true LeaderElectionResourceLockInterface: leaderelection.LeaseHijacker(...) } ```

Types

This section is empty.

Jump to

Keyboard shortcuts

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