portlookup

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package portlookup contains the logic required to map arbitrary ports to the actual targeted ports(nodePorts) of the services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LookupTable

type LookupTable map[string]map[string]int

LookupTable is a lookup table for ports. It maps endpoint keys to port keys to the actual allocated ports.

type PortAllocator

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

func NewPortAllocator

func NewPortAllocator() *PortAllocator

func (*PortAllocator) AllocatePorts

func (pa *PortAllocator) AllocatePorts(endpointKey string, portkeys []string) bool

AllocatePorts allocates ports for the given keys. If a key already exists in the lookup table, it is ignored.

func (*PortAllocator) AllocatePortsForLoadBalancers

func (pa *PortAllocator) AllocatePortsForLoadBalancers(loadBalancers kubelbv1alpha1.LoadBalancerList) error

AllocatePortsForLoadBalancers allocates ports to the given load balancers. If a port is already allocated, it will be skipped.

func (*PortAllocator) AllocatePortsForRoutes

func (pa *PortAllocator) AllocatePortsForRoutes(routes []kubelbv1alpha1.Route) error

AllocatePortsForRoutes allocates ports for the routes. If a port is already allocated, it will be skipped.

func (*PortAllocator) DeallocateEndpoints

func (pa *PortAllocator) DeallocateEndpoints(endpointKeys []string)

DeallocateEndpoints deallocates all ports for the given endpoint key. If the endpoint key does not exist in the lookup table, it is ignored

func (*PortAllocator) DeallocatePorts

func (pa *PortAllocator) DeallocatePorts(endpointKey string, portkeys []string) bool

DeallocatePorts deallocates ports for the given keys. If a key does not exist in the lookup table, it is ignored.

func (*PortAllocator) DeallocatePortsForLoadBalancer

func (pa *PortAllocator) DeallocatePortsForLoadBalancer(loadBalancer kubelbv1alpha1.LoadBalancer) error

DeallocatePortsForLoadBalancer deallocates ports against the given load balancer.

func (*PortAllocator) DeallocatePortsForRoute

func (pa *PortAllocator) DeallocatePortsForRoute(route kubelbv1alpha1.Route) error

DeallocatePortsForRoutes deallocates ports for the route.

func (*PortAllocator) GetPortLookupTable

func (pa *PortAllocator) GetPortLookupTable() LookupTable

func (*PortAllocator) LoadState

func (pa *PortAllocator) LoadState(ctx context.Context, apiReader client.Reader) error

LoadState loads the port lookup table from the existing loadbalancers.

func (*PortAllocator) Lookup

func (pa *PortAllocator) Lookup(endpointKey, portKey string) (int, bool)

Jump to

Keyboard shortcuts

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