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.