utils

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindContainerPort

func FindContainerPort(pod *api.Pod, svcPort *api.ServicePort) int

FindContainerPort Find the container's port number of a known servicePort Search criteria: 1. svcPort.TargetPort is a number: this is the right container's port 2. svcPort.TargetPort is a named port (not a number): find a container's port with that name and use its ContainerPort If targetPort is neither a valid port number nor a declared named port, return zero which means that the port was not found

func FindServicePort

func FindServicePort(svc *api.Service, servicePort string) *api.ServicePort

FindServicePort ...

func RebalanceWeight added in v0.13.0

func RebalanceWeight(clusters []*WeightCluster, initialWeight int)

RebalanceWeight ...

Types

type Endpoint

type Endpoint struct {
	IP        string
	Port      int
	Target    string
	TargetRef string
}

Endpoint ...

func CreateEndpoints

func CreateEndpoints(cache types.Cache, svc *api.Service, svcPort *api.ServicePort, useEndpointSlices bool) (ready, notReady []*Endpoint, err error)

CreateEndpoints ...

func CreateSvcEndpoint

func CreateSvcEndpoint(svc *api.Service, svcPort *api.ServicePort) (endpoint *Endpoint, err error)

CreateSvcEndpoint ...

func (*Endpoint) String

func (e *Endpoint) String() string

type WeightCluster added in v0.13.0

type WeightCluster struct {
	Weight int
	Length int
}

WeightCluster ...

Jump to

Keyboard shortcuts

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