Documentation ¶
Overview ¶
Package portlookup contains the logic required to map arbitrary ports to the actual targeted ports(nodePorts) of the services.
Index ¶
- type LookupTable
- type PortAllocator
- func (pa *PortAllocator) AllocatePorts(endpointKey string, portkeys []string) bool
- func (pa *PortAllocator) AllocatePortsForLoadBalancers(loadBalancers kubelbv1alpha1.LoadBalancerList) error
- func (pa *PortAllocator) AllocatePortsForRoutes(routes []kubelbv1alpha1.Route) error
- func (pa *PortAllocator) DeallocateEndpoints(endpointKeys []string)
- func (pa *PortAllocator) DeallocatePorts(endpointKey string, portkeys []string) bool
- func (pa *PortAllocator) DeallocatePortsForLoadBalancer(loadBalancer kubelbv1alpha1.LoadBalancer) error
- func (pa *PortAllocator) DeallocatePortsForRoute(route kubelbv1alpha1.Route) error
- func (pa *PortAllocator) GetPortLookupTable() LookupTable
- func (pa *PortAllocator) LoadState(ctx context.Context, apiReader client.Reader) error
- func (pa *PortAllocator) Lookup(endpointKey, portKey string) (int, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LookupTable ¶
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