Documentation
¶
Index ¶
Constants ¶
const ErrNotLeader constable.Error = "write attempt rejected as client is not leader"
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(podInfo *downward.PodInfo, deployment *appsv1.Deployment, opts ...kubeclient.Option) ( *kubeclient.Client, controllerinit.RunnerWrapper, error, )
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.