loadbalancer

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoxiMaxWeight               = 10
	LoxiMultusServiceAnnotation = "loxilb.io/multus-nets"
	PoolNameAnnotation          = "loxilb.io/poolSelect"
	SecPoolNameAnnotation       = "loxilb.io/poolSelectSecondary"

	MaxExternalSecondaryIPsNum = 4
)

Variables

This section is empty.

Functions

func GenKey

func GenKey(ns, name string) string

GenKey generate key for cache

func GenSPKey added in v0.9.1

func GenSPKey(IPString string, Port uint16, Protocol string) string

GenSPKey generate key for cache

Types

type IPPoolTable added in v0.9.7

type IPPoolTable map[string]*ippool.IPPool

type LbArgs

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

type LbCacheEntry

type LbCacheEntry struct {
	LbMode    int
	Timeout   int
	ActCheck  bool
	PrefLocal bool

	Inst           string
	Addr           string
	State          string
	NodeLabel      string
	ProbeType      string
	ProbePort      uint16
	ProbeReq       string
	ProbeResp      string
	ProbeTimeo     uint32
	ProbeRetries   int
	EpSelect       api.EpSelect
	IPPool         *ippool.IPPool
	SIPPools       []*ippool.IPPool
	SecIPs         []string
	LbServicePairs map[string]*LbServicePairEntry
	// contains filtered or unexported fields
}

type LbCacheKey

type LbCacheKey struct {
	Namespace string
	Name      string
}

type LbCacheTable

type LbCacheTable map[string]*LbCacheEntry

type LbModelEnt added in v0.9.0

type LbModelEnt struct {
	LbModel api.LoadBalancerModel
}

type LbServicePairEntry added in v0.9.1

type LbServicePairEntry struct {
	ExternalIP  string
	Port        uint16
	Protocol    string
	StaticIP    bool
	InRange     bool
	IdentIPAM   string
	LbModelList []api.LoadBalancerModel
}

type LoxiInstRole added in v0.9.8

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

type Manager

type Manager struct {
	LoxiClients     *api.LoxiClientPool
	LoxiPeerClients *api.LoxiClientPool

	ElectionRunOnce bool

	ClientAliveCh     chan *api.LoxiClient
	ClientPurgeCh     chan *api.LoxiClient
	ClientSelMasterCh chan bool
	ClientDeadCh      chan struct{}
	// contains filtered or unexported fields
}

func NewLoadBalancerManager

func NewLoadBalancerManager(
	kubeClient clientset.Interface,
	loxiClients *api.LoxiClientPool,
	loxiPeerClients *api.LoxiClientPool,
	ipPoolTbl map[string]*ippool.IPPool,
	ip6PoolTbl map[string]*ippool.IPPool,
	networkConfig *config.NetworkConfig,
	informerFactory informers.SharedInformerFactory) *Manager

Create and Init Manager. Manager is called by kube-loxilb when k8s service is created & updated.

func (*Manager) AddLoxiCIDRPool added in v0.9.8

func (m *Manager) AddLoxiCIDRPool(poolName string, cidr string) error

func (*Manager) AddLoxiInstAddr added in v0.9.7

func (m *Manager) AddLoxiInstAddr(name string, IP net.IP) error

func (*Manager) DeleteAllLoadBalancer

func (m *Manager) DeleteAllLoadBalancer()

func (*Manager) DeleteLoxiCIDRPool added in v0.9.8

func (m *Manager) DeleteLoxiCIDRPool(poolName string, cidr string) error

func (*Manager) DeleteLoxiInstAddr added in v0.9.7

func (m *Manager) DeleteLoxiInstAddr(name string) error

func (*Manager) DiscoverLoxiLBPeerServices added in v0.9.1

func (m *Manager) DiscoverLoxiLBPeerServices(loxiLBAliveCh chan *api.LoxiClient, loxiLBDeadCh chan struct{}, loxiLBPurgeCh chan *api.LoxiClient)

func (*Manager) DiscoverLoxiLBServices added in v0.9.0

func (m *Manager) DiscoverLoxiLBServices(loxiLBAliveCh chan *api.LoxiClient, loxiLBDeadCh chan struct{}, loxiLBPurgeCh chan *api.LoxiClient, excludeList []string)

func (*Manager) ResetRolesOnNeedRebalanceInstLoxiLBRoles added in v0.9.8

func (m *Manager) ResetRolesOnNeedRebalanceInstLoxiLBRoles() bool

func (*Manager) Run

func (m *Manager) Run(stopCh <-chan struct{})

func (*Manager) SelectInstLoxiLBRoles added in v0.9.8

func (m *Manager) SelectInstLoxiLBRoles(instName string, selhint int) (bool, int)

func (*Manager) SelectLoxiLBRoles added in v0.9.0

func (m *Manager) SelectLoxiLBRoles(sendSigCh bool, loxiLBSelMasterEvent chan bool)

type SvcPair

type SvcPair struct {
	IPString   string
	Port       int32
	Protocol   string
	InRange    bool
	StaticIP   bool
	IdentIPAM  string
	IPAllocd   bool
	K8sSvcPort corev1.ServicePort
}

func (SvcPair) String added in v0.9.1

func (s SvcPair) String() string

Jump to

Keyboard shortcuts

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