election

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Client     clientset.Interface
	ElectionID string
	Callbacks  leaderelection.LeaderCallbacks
	Logger     *zap.SugaredLogger
}

Config holds the configuration for a leader election

type Elector

type Elector struct {
	Config
	Elector *leaderelection.LeaderElector
}

func NewElector

func NewElector(config Config) Elector

NewElector returns an instance of Elector based on config.

func (Elector) IsLeader

func (e Elector) IsLeader() bool

func (Elector) Run

func (e Elector) Run(ctx context.Context)

type PodInfo

type PodInfo struct {
	Name      string
	Namespace string
	NodeIP    string
	// Labels selectors of the running pod
	// This is used to search for other Ingress controller pods
	Labels map[string]string
}

PodInfo contains runtime information about the pod running the Ingres controller

func GetPodDetails

func GetPodDetails() (*PodInfo, error)

GetPodDetails returns runtime information about the pod: name, namespace and IP of the node where it is running

Jump to

Keyboard shortcuts

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