Documentation ¶
Index ¶
- Constants
- type ConsistentHashPolicy
- func (ch *ConsistentHashPolicy) Name() string
- func (ch *ConsistentHashPolicy) Pick(endpoints []string, srcAddr net.Addr, netConn net.Conn, cliReq *http.Request) (endpoint string, req *http.Request, err error)
- func (ch *ConsistentHashPolicy) Release()
- func (ch *ConsistentHashPolicy) Sync(endpoints []string)
- func (ch *ConsistentHashPolicy) Update(oldDr, dr *istioapi.DestinationRule)
- type HashKey
- type LoadBalancer
- func (lb *LoadBalancer) CleanupStaleStickySessions(svcPort proxy.ServicePortName)
- func (lb *LoadBalancer) DeleteService(svcPort proxy.ServicePortName)
- func (lb *LoadBalancer) GetServicePortName(namespacedName types.NamespacedName, port int) (proxy.ServicePortName, bool)
- func (lb *LoadBalancer) NewService(svcPort proxy.ServicePortName, affinityType v1.ServiceAffinity, ttlSeconds int) error
- func (lb *LoadBalancer) NextEndpoint(svcPort proxy.ServicePortName, srcAddr net.Addr, sessionAffinityReset bool) (string, error)
- func (lb *LoadBalancer) OnDestinationRuleAdd(dr *istioapi.DestinationRule)
- func (lb *LoadBalancer) OnDestinationRuleDelete(dr *istioapi.DestinationRule)
- func (lb *LoadBalancer) OnDestinationRuleSynced()
- func (lb *LoadBalancer) OnDestinationRuleUpdate(oldDr, dr *istioapi.DestinationRule)
- func (lb *LoadBalancer) OnEndpointsAdd(endpoints *v1.Endpoints)
- func (lb *LoadBalancer) OnEndpointsDelete(endpoints *v1.Endpoints)
- func (lb *LoadBalancer) OnEndpointsSynced()
- func (lb *LoadBalancer) OnEndpointsUpdate(oldEndpoints *v1.Endpoints, endpoints *v1.Endpoints)
- func (lb *LoadBalancer) OnServiceAdd(service *v1.Service)
- func (lb *LoadBalancer) OnServiceDelete(service *v1.Service)
- func (lb *LoadBalancer) OnServiceSynced()
- func (lb *LoadBalancer) OnServiceUpdate(oldService, service *v1.Service)
- func (lb *LoadBalancer) Run() error
- func (lb *LoadBalancer) ServiceHasEndpoints(svcPort proxy.ServicePortName) bool
- func (lb *LoadBalancer) TryConnectEndpoints(service proxy.ServicePortName, srcAddr net.Addr, protocol string, ...) (out net.Conn, err error)
- type Policy
- type RandomPolicy
- func (rd *RandomPolicy) Name() string
- func (rd *RandomPolicy) Pick(endpoints []string, srcAddr net.Addr, netConn net.Conn, cliReq *http.Request) (string, *http.Request, error)
- func (rd *RandomPolicy) Release()
- func (rd *RandomPolicy) Sync(endpoints []string)
- func (rd *RandomPolicy) Update(oldDr, dr *istioapi.DestinationRule)
- type RoundRobinPolicy
- func (*RoundRobinPolicy) Name() string
- func (*RoundRobinPolicy) Pick(endpoints []string, srcAddr net.Addr, netConn net.Conn, cliReq *http.Request) (string, *http.Request, error)
- func (*RoundRobinPolicy) Release()
- func (*RoundRobinPolicy) Sync(endpoints []string)
- func (*RoundRobinPolicy) Update(oldDr, dr *istioapi.DestinationRule)
- type ServiceObject
Constants ¶
View Source
const ( RoundRobin = "ROUND_ROBIN" Random = "RANDOM" ConsistentHash = "CONSISTENT_HASH" HttpHeader = "HTTP_HEADER" UserSourceIP = "USER_SOURCE_IP" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistentHashPolicy ¶
type ConsistentHashPolicy struct { Config *v1alpha1.ConsistentHash // contains filtered or unexported fields }
func NewConsistentHashPolicy ¶
func NewConsistentHashPolicy(config *v1alpha1.ConsistentHash, dr *istioapi.DestinationRule, endpoints []string) *ConsistentHashPolicy
func (*ConsistentHashPolicy) Name ¶
func (ch *ConsistentHashPolicy) Name() string
func (*ConsistentHashPolicy) Release ¶
func (ch *ConsistentHashPolicy) Release()
func (*ConsistentHashPolicy) Sync ¶
func (ch *ConsistentHashPolicy) Sync(endpoints []string)
func (*ConsistentHashPolicy) Update ¶
func (ch *ConsistentHashPolicy) Update(oldDr, dr *istioapi.DestinationRule)
type LoadBalancer ¶
type LoadBalancer struct { Config *v1alpha1.LoadBalancer // contains filtered or unexported fields }
func New ¶
func New(config *v1alpha1.LoadBalancer, kubeClient kubernetes.Interface, istioClient istio.Interface, syncPeriod time.Duration) *LoadBalancer
func (*LoadBalancer) CleanupStaleStickySessions ¶
func (lb *LoadBalancer) CleanupStaleStickySessions(svcPort proxy.ServicePortName)
func (*LoadBalancer) DeleteService ¶
func (lb *LoadBalancer) DeleteService(svcPort proxy.ServicePortName)
func (*LoadBalancer) GetServicePortName ¶
func (lb *LoadBalancer) GetServicePortName(namespacedName types.NamespacedName, port int) (proxy.ServicePortName, bool)
func (*LoadBalancer) NewService ¶
func (lb *LoadBalancer) NewService(svcPort proxy.ServicePortName, affinityType v1.ServiceAffinity, ttlSeconds int) error
func (*LoadBalancer) NextEndpoint ¶
func (lb *LoadBalancer) NextEndpoint(svcPort proxy.ServicePortName, srcAddr net.Addr, sessionAffinityReset bool) (string, error)
func (*LoadBalancer) OnDestinationRuleAdd ¶
func (lb *LoadBalancer) OnDestinationRuleAdd(dr *istioapi.DestinationRule)
func (*LoadBalancer) OnDestinationRuleDelete ¶
func (lb *LoadBalancer) OnDestinationRuleDelete(dr *istioapi.DestinationRule)
func (*LoadBalancer) OnDestinationRuleSynced ¶
func (lb *LoadBalancer) OnDestinationRuleSynced()
func (*LoadBalancer) OnDestinationRuleUpdate ¶
func (lb *LoadBalancer) OnDestinationRuleUpdate(oldDr, dr *istioapi.DestinationRule)
func (*LoadBalancer) OnEndpointsAdd ¶
func (lb *LoadBalancer) OnEndpointsAdd(endpoints *v1.Endpoints)
func (*LoadBalancer) OnEndpointsDelete ¶
func (lb *LoadBalancer) OnEndpointsDelete(endpoints *v1.Endpoints)
func (*LoadBalancer) OnEndpointsSynced ¶
func (lb *LoadBalancer) OnEndpointsSynced()
func (*LoadBalancer) OnEndpointsUpdate ¶
func (lb *LoadBalancer) OnEndpointsUpdate(oldEndpoints *v1.Endpoints, endpoints *v1.Endpoints)
func (*LoadBalancer) OnServiceAdd ¶
func (lb *LoadBalancer) OnServiceAdd(service *v1.Service)
func (*LoadBalancer) OnServiceDelete ¶
func (lb *LoadBalancer) OnServiceDelete(service *v1.Service)
func (*LoadBalancer) OnServiceSynced ¶
func (lb *LoadBalancer) OnServiceSynced()
func (*LoadBalancer) OnServiceUpdate ¶
func (lb *LoadBalancer) OnServiceUpdate(oldService, service *v1.Service)
func (*LoadBalancer) Run ¶
func (lb *LoadBalancer) Run() error
func (*LoadBalancer) ServiceHasEndpoints ¶
func (lb *LoadBalancer) ServiceHasEndpoints(svcPort proxy.ServicePortName) bool
func (*LoadBalancer) TryConnectEndpoints ¶
func (lb *LoadBalancer) TryConnectEndpoints(service proxy.ServicePortName, srcAddr net.Addr, protocol string, netConn net.Conn, cliReq *http.Request) (out net.Conn, err error)
TryConnectEndpoints attempts to connect to the next available endpoint for the given service, cycling through until it is able to successfully connect, or it has tried with all timeouts in EndpointDialTimeouts.
type RandomPolicy ¶
type RandomPolicy struct {
// contains filtered or unexported fields
}
func NewRandomPolicy ¶
func NewRandomPolicy() *RandomPolicy
func (*RandomPolicy) Name ¶
func (rd *RandomPolicy) Name() string
func (*RandomPolicy) Release ¶
func (rd *RandomPolicy) Release()
func (*RandomPolicy) Sync ¶
func (rd *RandomPolicy) Sync(endpoints []string)
func (*RandomPolicy) Update ¶
func (rd *RandomPolicy) Update(oldDr, dr *istioapi.DestinationRule)
type RoundRobinPolicy ¶
type RoundRobinPolicy struct { }
RoundRobinPolicy is a default policy.
func NewRoundRobinPolicy ¶
func NewRoundRobinPolicy() *RoundRobinPolicy
func (*RoundRobinPolicy) Name ¶
func (*RoundRobinPolicy) Name() string
func (*RoundRobinPolicy) Release ¶
func (*RoundRobinPolicy) Release()
func (*RoundRobinPolicy) Sync ¶
func (*RoundRobinPolicy) Sync(endpoints []string)
func (*RoundRobinPolicy) Update ¶
func (*RoundRobinPolicy) Update(oldDr, dr *istioapi.DestinationRule)
type ServiceObject ¶
type ServiceObject struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.