Documentation ¶
Index ¶
- Constants
- func NodeReady(nodeStatus v1.NodeStatus) bool
- func RemoveHintsFromSlices(si *SliceInfo) ([]*discovery.EndpointSlice, []*discovery.EndpointSlice)
- type Allocation
- type EndpointZoneInfo
- type SliceInfo
- type TopologyCache
- func (t *TopologyCache) AddHints(si *SliceInfo) ([]*discovery.EndpointSlice, []*discovery.EndpointSlice)
- func (t *TopologyCache) GetOverloadedServices() []string
- func (t *TopologyCache) RemoveHints(serviceKey string, addrType discovery.AddressType)
- func (t *TopologyCache) SetHints(serviceKey string, addrType discovery.AddressType, ...)
- func (t *TopologyCache) SetNodes(nodes []*v1.Node)
Constants ¶
const ( // OverloadThreshold represents the maximum overload any individual endpoint // should be exposed to. OverloadThreshold float64 = 0.2 )
Variables ¶
This section is empty.
Functions ¶
func NodeReady ¶
func NodeReady(nodeStatus v1.NodeStatus) bool
NodeReady returns true if the Node has a status condition of type "NodeReady" with a status of "True".
func RemoveHintsFromSlices ¶
func RemoveHintsFromSlices(si *SliceInfo) ([]*discovery.EndpointSlice, []*discovery.EndpointSlice)
RemoveHintsFromSlices removes topology hints on EndpointSlices and returns updated lists of EndpointSlices to create and update.
Types ¶
type Allocation ¶
Allocation describes the number of endpoints that should be allocated for a zone.
type EndpointZoneInfo ¶
EndpointZoneInfo tracks the distribution of endpoints across zones for a Service.
type SliceInfo ¶
type SliceInfo struct { ServiceKey string AddressType discovery.AddressType ToCreate []*discovery.EndpointSlice ToUpdate []*discovery.EndpointSlice Unchanged []*discovery.EndpointSlice }
SliceInfo stores information about EndpointSlices for the reconciliation process.
type TopologyCache ¶
type TopologyCache struct {
// contains filtered or unexported fields
}
TopologyCache tracks the distribution of Nodes and endpoints across zones.
func NewTopologyCache ¶
func NewTopologyCache() *TopologyCache
NewTopologyCache initializes a new TopologyCache.
func (*TopologyCache) AddHints ¶
func (t *TopologyCache) AddHints(si *SliceInfo) ([]*discovery.EndpointSlice, []*discovery.EndpointSlice)
AddHints adds or updates topology hints on EndpointSlices and returns updated lists of EndpointSlices to create and update.
func (*TopologyCache) GetOverloadedServices ¶
func (t *TopologyCache) GetOverloadedServices() []string
GetOverloadedServices returns a list of Service keys that refer to Services that have crossed the overload threshold for any zone.
func (*TopologyCache) RemoveHints ¶
func (t *TopologyCache) RemoveHints(serviceKey string, addrType discovery.AddressType)
RemoveHints removes topology hints for the provided serviceKey and addrType from this cache.
func (*TopologyCache) SetHints ¶
func (t *TopologyCache) SetHints(serviceKey string, addrType discovery.AddressType, allocatedHintsByZone EndpointZoneInfo)
SetHints sets topology hints for the provided serviceKey and addrType in this cache.
func (*TopologyCache) SetNodes ¶
func (t *TopologyCache) SetNodes(nodes []*v1.Node)
SetNodes updates the Node distribution for the TopologyCache.