package proxy
import "k8s.io/kubernetes/pkg/proxy"
Package proxy implements the layer-3 network proxy.
Index ¶
- Variables
- type LoadBalancer
- type LoadBalancerRR
- func NewLoadBalancerRR() *LoadBalancerRR
- func (lb *LoadBalancerRR) CleanupStaleStickySessions(service types.NamespacedName, port string)
- func (lb *LoadBalancerRR) NewService(service types.NamespacedName, port string, affinityType api.AffinityType, ttlMinutes int) error
- func (lb *LoadBalancerRR) NextEndpoint(service types.NamespacedName, port string, srcAddr net.Addr) (string, error)
- func (lb *LoadBalancerRR) OnUpdate(allEndpoints []api.Endpoints)
- type Proxier
- func CreateProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface, hostIP net.IP) *Proxier
- func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface) *Proxier
- func (proxier *Proxier) OnUpdate(services []api.Service)
- func (proxier *Proxier) SyncLoop()
Variables ¶
var ( ErrMissingServiceEntry = errors.New("missing service entry") ErrMissingEndpoints = errors.New("missing endpoints") )
Types ¶
type LoadBalancer ¶
type LoadBalancer interface { // NextEndpoint returns the endpoint to handle a request for the given // service-port and source address. NextEndpoint(service types.NamespacedName, port string, srcAddr net.Addr) (string, error) NewService(service types.NamespacedName, port string, sessionAffinityType api.AffinityType, stickyMaxAgeMinutes int) error CleanupStaleStickySessions(service types.NamespacedName, port string) }
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 ¶
func (lb *LoadBalancerRR) CleanupStaleStickySessions(service types.NamespacedName, port string)
func (*LoadBalancerRR) NewService ¶
func (lb *LoadBalancerRR) NewService(service types.NamespacedName, port string, affinityType api.AffinityType, ttlMinutes int) error
func (*LoadBalancerRR) NextEndpoint ¶
func (lb *LoadBalancerRR) NextEndpoint(service types.NamespacedName, port string, srcAddr net.Addr) (string, error)
NextEndpoint returns a service endpoint. The service endpoint is chosen using the round-robin algorithm.
func (*LoadBalancerRR) OnUpdate ¶
func (lb *LoadBalancerRR) OnUpdate(allEndpoints []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 ¶
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 ¶
func CreateProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface, hostIP net.IP) *Proxier
func NewProxier ¶
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.
func (*Proxier) OnUpdate ¶
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.
func (*Proxier) SyncLoop ¶
func (proxier *Proxier) SyncLoop()
SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.
Source Files ¶
doc.go loadbalancer.go proxier.go roundrobin.go udp_server.go
Directories ¶
Path | Synopsis |
---|---|
pkg/proxy/config | Package config provides decoupling between various configuration sources (etcd, files,...) and the pieces that actually care about them (loadbalancer, proxy). |
- Version
- v0.14.2
- Published
- Apr 8, 2015
- Platform
- windows/amd64
- Imports
- 17 packages
- Last checked
- 47 seconds ago –
Tools for package owners.