Documentation
¶
Index ¶
- Variables
- type CPU
- type LoadBalancerRR
- func (lb *LoadBalancerRR) CleanupStaleStickySessions(svcPort proxy.ServicePortName)
- func (lb *LoadBalancerRR) DeleteService(svcPort proxy.ServicePortName)
- func (lb *LoadBalancerRR) NewService(svcPort proxy.ServicePortName, affinityType v1.ServiceAffinity, ttlSeconds int) error
- func (lb *LoadBalancerRR) NextEndpoint(svcPort proxy.ServicePortName, srcAddr net.Addr, sessionAffinityReset bool) (string, error)
- func (lb *LoadBalancerRR) OnEndpointsAdd(endpoints *v1.Endpoints)
- func (lb *LoadBalancerRR) OnEndpointsDelete(endpoints *v1.Endpoints)
- func (lb *LoadBalancerRR) OnEndpointsSynced()
- func (lb *LoadBalancerRR) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoints)
- func (lb *LoadBalancerRR) ServiceHasEndpoints(svcPort proxy.ServicePortName) bool
- type Memory
- type Node
- type NodeAddress
- type NodeList
- type NodeMetadata
- type NodeStatus
- type P
- type Pod
- type PodList
- type PodMetadata
- type PodSpec
- type PodStatus
- type ResourceList
- type Resources
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingServiceEntry = errors.New("missing service entry") ErrMissingEndpoints = errors.New("missing endpoints") )
View Source
var ( Nodes map[string]string Pods map[string]*P BestNode string EndpointsMap map[string][]string NextEndpoints []string ResLists map[string]ResourceList )
View Source
var ( KUBERNETES_SERVICE_HOST = os.Getenv("KUBERNETES_SERVICE_HOST") KUBERNETES_SERVICE_PORT = os.Getenv("KUBERNETES_SERVICE_PORT") )
View Source
var ( CPU_THRESHOLD = 0.8 MEMORY_THRESHOLD = 0.8 WEIGHT_CPU = 0.4 WEIGHT_MEMORY = 0.5 WEIGHT_LATENCY = 0.1 )
Functions ¶
This section is empty.
Types ¶
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(svcPort proxy.ServicePortName)
func (*LoadBalancerRR) DeleteService ¶
func (lb *LoadBalancerRR) DeleteService(svcPort proxy.ServicePortName)
func (*LoadBalancerRR) NewService ¶
func (lb *LoadBalancerRR) NewService(svcPort proxy.ServicePortName, affinityType v1.ServiceAffinity, ttlSeconds int) error
func (*LoadBalancerRR) NextEndpoint ¶
func (lb *LoadBalancerRR) NextEndpoint(svcPort proxy.ServicePortName, srcAddr net.Addr, sessionAffinityReset bool) (string, error)
NextEndpoint returns a service endpoint. The service endpoint is chosen using the round-robin algorithm.
func (*LoadBalancerRR) OnEndpointsAdd ¶
func (lb *LoadBalancerRR) OnEndpointsAdd(endpoints *v1.Endpoints)
func (*LoadBalancerRR) OnEndpointsDelete ¶
func (lb *LoadBalancerRR) OnEndpointsDelete(endpoints *v1.Endpoints)
func (*LoadBalancerRR) OnEndpointsSynced ¶
func (lb *LoadBalancerRR) OnEndpointsSynced()
func (*LoadBalancerRR) OnEndpointsUpdate ¶
func (lb *LoadBalancerRR) OnEndpointsUpdate(oldEndpoints, endpoints *v1.Endpoints)
func (*LoadBalancerRR) ServiceHasEndpoints ¶
func (lb *LoadBalancerRR) ServiceHasEndpoints(svcPort proxy.ServicePortName) bool
ServiceHasEndpoints checks whether a service entry has endpoints.
type Node ¶
type Node struct { Metadata NodeMetadata `json:"metadata"` Status NodeStatus `json:"status"` }
type NodeAddress ¶
type NodeMetadata ¶
type NodeMetadata struct {
Name string `json:"name"`
}
type NodeStatus ¶
type NodeStatus struct {
Addresses []NodeAddress `json:"addresses"`
}
type Pod ¶
type Pod struct { Metadata PodMetadata `json:"metadata"` Status PodStatus `json:"status"` Spec PodSpec `json:"spec"` }
type PodMetadata ¶
type PodMetadata struct {
Name string `json:"name"`
}
type ResourceList ¶
Click to show internal directories.
Click to hide internal directories.