endpoint_resolver

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeDoesNotHaveInternalAddress = errors.New("node does not have internal address")
View Source
var ErrNotFound = errors.New("backend not found")

Functions

func NewDefaultEndpointResolver

func NewDefaultEndpointResolver(serviceLister corelisters.ServiceLister, endpointLister corelisters.EndpointsLister) *defaultEndpointResolver

NewDefaultEndpointResolver constructs new defaultEndpointResolver

Types

type EndpointAddress

type EndpointAddress struct {
	Name string
	IP   string
	Port int
}

An endpoint provided by pod directly.

type EndpointResolver

type EndpointResolver interface {
	// convert Service Backend to int or string
	ServiceBackendToIntOrString(port nwv1.ServiceBackendPort) intstr.IntOrString
	// GetListTargetPort returns the list of target ports for the service.
	GetListTargetPort(svcKey types.NamespacedName, port intstr.IntOrString) ([]int, error)
	ResolvePodEndpoints(svcKey types.NamespacedName, port intstr.IntOrString) ([]EndpointAddress, error)
	ResolveNodePortEndpoints(svcKey types.NamespacedName, port intstr.IntOrString, nodes []*corev1.Node) ([]EndpointAddress, error)
}

EndpointResolver resolves the endpoints for specific service & service Port.

Jump to

Keyboard shortcuts

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