memberlist

package
v1.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster implements ClusterInterface.

func NewCluster

func NewCluster(
	clusterBindPort int,
	localNodeIP net.IP,
	nodeName string,
	nodeInformer coreinformers.NodeInformer,
	externalIPPoolInformer crdinformers.ExternalIPPoolInformer,
) (*Cluster, error)

NewCluster returns a new *Cluster.

func (*Cluster) AddClusterEventHandler

func (c *Cluster) AddClusterEventHandler(handler clusterNodeEventHandler)

AddClusterEventHandler adds a clusterNodeEventHandler, which will run when consistentHashMap is updated, due to an ExternalIPPool or Node event.

func (*Cluster) Run

func (c *Cluster) Run(stopCh <-chan struct{})

Run will join all the other K8s Nodes in a memberlist cluster and will create defaultWorkers workers (go routines) which will process the ExternalIPPool or Node events from the work queue.

func (*Cluster) ShouldSelectEgress

func (c *Cluster) ShouldSelectEgress(egress *v1alpha2.Egress) (bool, error)

ShouldSelectEgress returns true if the local Node selected as the owner Node of the Egress, the local Node in the cluster holds the same consistent hash ring for each ExternalIPPool, consistentHash.Get gets the closest item (Node name) in the hash to the provided key(egressIP), if the name of the local Node is equal to the name of the selected Node, returns true.

Jump to

Keyboard shortcuts

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