route

package
v0.13.8 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RRLB

type RRLB struct {
	IPs []string // immutable
	// contains filtered or unexported fields
}

RRLB is round-robin load balancer

func (*RRLB) Get added in v0.13.1

func (lb *RRLB) Get(badAddr *badAddrTable) (ip string)

type Table

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

func (*Table) Lookup

func (t *Table) Lookup(addr string) string

Lookup returns target pod's addr to connect to. If target pod's addr is not found in table, it will return empty string

func (*Table) MarkBad

func (t *Table) MarkBad(addr string)

func (*Table) SetHostRoute

func (t *Table) SetHostRoute(host string, lb *RRLB)

func (*Table) SetHostRoutes

func (t *Table) SetHostRoutes(routes map[string]*RRLB)

SetHostRoutes sets route from host to RRLB (IPs)

In Kubernetes cluster, host is dns name service.namespace.svc.cluster.local and IPs is list of pod IPs from service's endpoint.

func (*Table) SetPortRoutes

func (t *Table) SetPortRoutes(routes map[string]string)

SetPortRoutes sets route from service's addr to pod's port to make proxy connect directly to pod.

Jump to

Keyboard shortcuts

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