Documentation
¶
Overview ¶
Package proxy implements the layer-3 network proxy.
Index ¶
- Variables
- type LoadBalancer
- type LoadBalancerRR
- func (lb *LoadBalancerRR) CleanupStaleStickySessions(svcPort ServicePortName)
- func (lb *LoadBalancerRR) NewService(svcPort ServicePortName, affinityType api.AffinityType, ttlMinutes int) error
- func (lb *LoadBalancerRR) NextEndpoint(svcPort ServicePortName, srcAddr net.Addr) (string, error)
- func (lb *LoadBalancerRR) OnUpdate(allEndpoints []api.Endpoints)
- type Proxier
- type ServicePortName
Constants ¶
This section is empty.
Variables ¶
var (
ErrMissingServiceEntry = errors.New("missing service entry")
ErrMissingEndpoints = errors.New("missing endpoints")
)
Functions ¶
This section is empty.
Types ¶
type LoadBalancer ¶
type LoadBalancer interface {
// NextEndpoint returns the endpoint to handle a request for the given
// service-port and source address.
NextEndpoint(service ServicePortName, srcAddr net.Addr) (string, error)
NewService(service ServicePortName, sessionAffinityType api.AffinityType, stickyMaxAgeMinutes int) error
CleanupStaleStickySessions(service ServicePortName)
}
LoadBalancer is an interface for distributing incoming requests to service endpoints.
type LoadBalancerRR ¶
type LoadBalancerRR struct {
// contains filtered or unexported fields
}
LoadBalancerRR is a round-robin load balancer.
func NewLoadBalancerRR ¶
func NewLoadBalancerRR() *LoadBalancerRR
NewLoadBalancerRR returns a new LoadBalancerRR.
func (*LoadBalancerRR) CleanupStaleStickySessions ¶ added in v0.8.0
func (lb *LoadBalancerRR) CleanupStaleStickySessions(svcPort ServicePortName)
func (*LoadBalancerRR) NewService ¶ added in v0.8.0
func (lb *LoadBalancerRR) NewService(svcPort ServicePortName, affinityType api.AffinityType, ttlMinutes int) error
func (*LoadBalancerRR) NextEndpoint ¶
func (lb *LoadBalancerRR) NextEndpoint(svcPort ServicePortName, srcAddr net.Addr) (string, error)
NextEndpoint returns a service endpoint. The service endpoint is chosen using the round-robin algorithm.
type Proxier ¶
type Proxier struct {
// contains filtered or unexported fields
}
Proxier is a simple proxy for TCP connections between a localhost:lport and services that provide the actual implementations.
func CreateProxier ¶ added in v0.13.1
func CreateProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface, hostIP net.IP) *Proxier
func NewProxier ¶
func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface) *Proxier
NewProxier returns a new Proxier given a LoadBalancer and an address on which to listen. Because of the iptables logic, It is assumed that there is only a single Proxier active on a machine.
type ServicePortName ¶ added in v0.15.0
type ServicePortName struct {
types.NamespacedName
Port string
}
ServicePortName carries a namespace + name + portname. This is the unique identfier for a load-balanced service.
Directories
¶
Path | Synopsis |
---|---|
Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy).
|
Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy). |