controller-runtime: github.com/kubernetes-sigs/controller-runtime/pkg/leaderelection Index | Files | Directories

package leaderelection

import "github.com/kubernetes-sigs/controller-runtime/pkg/leaderelection"

Package leaderelection contains a constructors for a leader election resource lock. This is used to ensure that multiple copies of a controller manager can be run with only one active set of controllers, for active-passive HA.

It uses built-in Kubernetes leader election APIs.

Index

Package Files

doc.go leader_election.go

func NewResourceLock Uses

func NewResourceLock(config *rest.Config, recorderProvider recorder.Provider, options Options) (resourcelock.Interface, error)

NewResourceLock creates a new config map resource lock for use in a leader election loop

type Options Uses

type Options struct {
    // LeaderElection determines whether or not to use leader election when
    // starting the manager.
    LeaderElection bool

    // LeaderElectionNamespace determines the namespace in which the leader
    // election configmap will be created.
    LeaderElectionNamespace string

    // LeaderElectionID determines the name of the configmap that leader election
    // will use for holding the leader lock.
    LeaderElectionID string
}

Options provides the required configuration to create a new resource lock

Directories

PathSynopsis
fakePackage fake mocks a resource lock for testing purposes.

Package leaderelection imports 8 packages (graph). Updated 2019-07-08. Refresh now. Tools for package owners.