import "github.com/igm/kubernetes/pkg/proxy"
Package proxy implements the layer-3 network proxy.
doc.go loadbalancer.go proxier.go roundrobin.go udp_server.go
var ( ErrMissingServiceEntry = errors.New("missing service entry") ErrMissingEndpoints = errors.New("missing endpoints") )
type LoadBalancer interface { // NextEndpoint returns the endpoint to handle a request for the given // service and source address. NextEndpoint(service string, srcAddr net.Addr) (string, error) }
LoadBalancer is an interface for distributing incoming requests to service endpoints.
type LoadBalancerRR struct {
// contains filtered or unexported fields
}
LoadBalancerRR is a round-robin load balancer.
func NewLoadBalancerRR() *LoadBalancerRR
NewLoadBalancerRR returns a new LoadBalancerRR.
NextEndpoint returns a service endpoint. The service endpoint is chosen using the round-robin algorithm.
func (lb *LoadBalancerRR) OnUpdate(endpoints []api.Endpoints)
OnUpdate manages the registered service endpoints. Registered endpoints are updated if found in the update set or unregistered if missing from the update set.
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 NewProxier(loadBalancer LoadBalancer, listenAddress 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.
OnUpdate manages the active set of service proxies. Active service proxies are reinitialized if found in the update set or shutdown if missing from the update set.
SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.
Path | Synopsis |
---|---|
config | Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy). |
Package proxy imports 13 packages (graph). Updated 2018-04-17. Refresh now. Tools for package owners.