Documentation ¶
Index ¶
- Constants
- Variables
- func GetEndpointsCalculator(nodeLister, podLister cache.Indexer, zoneGetter negtypes.ZoneGetter, ...) negtypes.NetworkEndpointsCalculator
- func NewDelayRetryHandler(retryFunc func(), backoff backoffHandler) *backoffRetryHandler
- func NewExponentialBackendOffHandler(maxRetries int, minRetryDelay, maxRetryDelay time.Duration) *exponentialBackOffHandler
- func NewTransactionSyncer(negSyncerKey negtypes.NegSyncerKey, recorder record.EventRecorder, ...) negtypes.NegSyncer
- func NewTransactionTable() networkEndpointTransactionTable
- type ByNodeCount
- type ClusterL4ILBEndpointsCalculator
- func (l *ClusterL4ILBEndpointsCalculator) CalculateEndpoints(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
- func (l *ClusterL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
- func (l *ClusterL4ILBEndpointsCalculator) Mode() types.EndpointsCalculatorMode
- func (l *ClusterL4ILBEndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, ...) error
- type L7EndpointsCalculator
- func (l *L7EndpointsCalculator) CalculateEndpoints(eds []types.EndpointsData, _ map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
- func (l *L7EndpointsCalculator) CalculateEndpointsDegradedMode(eds []types.EndpointsData, _ map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
- func (l *L7EndpointsCalculator) Mode() types.EndpointsCalculatorMode
- func (l *L7EndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, ...) error
- type LocalL4ILBEndpointsCalculator
- func (l *LocalL4ILBEndpointsCalculator) CalculateEndpoints(eds []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
- func (l *LocalL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
- func (l *LocalL4ILBEndpointsCalculator) Mode() types.EndpointsCalculatorMode
- func (l *LocalL4ILBEndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, ...) error
- type NodeInfo
- type ZoneInfo
- type ZoneNetworkEndpointMapResult
Constants ¶
const (
MAX_NETWORK_ENDPOINTS_PER_BATCH = 500
)
Variables ¶
var ErrHandlerRetrying = fmt.Errorf("retry handler is retrying")
var ErrRetriesExceeded = fmt.Errorf("maximum retry exceeded")
Functions ¶
func GetEndpointsCalculator ¶ added in v1.9.0
func GetEndpointsCalculator(nodeLister, podLister cache.Indexer, zoneGetter negtypes.ZoneGetter, syncerKey negtypes.NegSyncerKey, mode negtypes.EndpointsCalculatorMode, logger klog.Logger, enableDualStackNEG bool) negtypes.NetworkEndpointsCalculator
func NewDelayRetryHandler ¶ added in v1.5.0
func NewDelayRetryHandler(retryFunc func(), backoff backoffHandler) *backoffRetryHandler
func NewExponentialBackendOffHandler ¶ added in v1.5.0
func NewTransactionSyncer ¶ added in v1.5.0
func NewTransactionSyncer( negSyncerKey negtypes.NegSyncerKey, recorder record.EventRecorder, cloud negtypes.NetworkEndpointGroupCloud, zoneGetter negtypes.ZoneGetter, podLister cache.Indexer, serviceLister cache.Indexer, endpointSliceLister cache.Indexer, nodeLister cache.Indexer, svcNegLister cache.Indexer, reflector readiness.Reflector, epc negtypes.NetworkEndpointsCalculator, kubeSystemUID string, svcNegClient svcnegclient.Interface, syncerMetrics *metricscollector.SyncerMetrics, customName bool, log klog.Logger, lpConfig labels.PodLabelPropagationConfig, enableDualStackNEG bool) negtypes.NegSyncer
func NewTransactionTable ¶ added in v1.5.0
func NewTransactionTable() networkEndpointTransactionTable
Types ¶
type ByNodeCount ¶ added in v1.9.0
type ByNodeCount []ZoneInfo
ByNodeCount implements sort.Interface for []ZoneInfo based on the node count.
func (ByNodeCount) Len ¶ added in v1.9.0
func (a ByNodeCount) Len() int
func (ByNodeCount) Less ¶ added in v1.9.0
func (a ByNodeCount) Less(i, j int) bool
func (ByNodeCount) Swap ¶ added in v1.9.0
func (a ByNodeCount) Swap(i, j int)
type ClusterL4ILBEndpointsCalculator ¶ added in v1.9.0
type ClusterL4ILBEndpointsCalculator struct {
// contains filtered or unexported fields
}
ClusterL4ILBEndpointGetter implements the NetworkEndpointsCalculator interface. It exposes methods to calculate Network endpoints for GCE_VM_IP NEGs when the service uses "ExternalTrafficPolicy: Cluster" mode This is the default mode. In this mode, the endpoints of the NEG are calculated by selecting nodes at random. Up to 25(subset size limit in this mode) are selected.
func NewClusterL4ILBEndpointsCalculator ¶ added in v1.9.0
func NewClusterL4ILBEndpointsCalculator(nodeLister listers.NodeLister, zoneGetter types.ZoneGetter, svcId string, logger klog.Logger) *ClusterL4ILBEndpointsCalculator
func (*ClusterL4ILBEndpointsCalculator) CalculateEndpoints ¶ added in v1.9.0
func (l *ClusterL4ILBEndpointsCalculator) CalculateEndpoints(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
CalculateEndpoints determines the endpoints in the NEGs based on the current service endpoints and the current NEGs.
func (*ClusterL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode ¶ added in v1.23.0
func (l *ClusterL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
func (*ClusterL4ILBEndpointsCalculator) Mode ¶ added in v1.9.0
func (l *ClusterL4ILBEndpointsCalculator) Mode() types.EndpointsCalculatorMode
Mode indicates the mode that the EndpointsCalculator is operating in.
func (*ClusterL4ILBEndpointsCalculator) ValidateEndpoints ¶ added in v1.23.0
func (l *ClusterL4ILBEndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, dupCount int) error
type L7EndpointsCalculator ¶ added in v1.9.0
type L7EndpointsCalculator struct {
// contains filtered or unexported fields
}
L7EndpointsCalculator implements methods to calculate Network endpoints for VM_IP_PORT NEGs
func NewL7EndpointsCalculator ¶ added in v1.9.0
func NewL7EndpointsCalculator(zoneGetter types.ZoneGetter, podLister, nodeLister cache.Indexer, svcPortName string, endpointType types.NetworkEndpointType, logger klog.Logger, enableDualStackNEG bool) *L7EndpointsCalculator
func (*L7EndpointsCalculator) CalculateEndpoints ¶ added in v1.9.0
func (l *L7EndpointsCalculator) CalculateEndpoints(eds []types.EndpointsData, _ map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
CalculateEndpoints determines the endpoints in the NEGs based on the current service endpoints and the current NEGs.
func (*L7EndpointsCalculator) CalculateEndpointsDegradedMode ¶ added in v1.23.0
func (l *L7EndpointsCalculator) CalculateEndpointsDegradedMode(eds []types.EndpointsData, _ map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
CalculateEndpoints determines the endpoints in the NEGs based on the current service endpoints and the current NEGs.
func (*L7EndpointsCalculator) Mode ¶ added in v1.9.0
func (l *L7EndpointsCalculator) Mode() types.EndpointsCalculatorMode
Mode indicates the mode that the EndpointsCalculator is operating in.
func (*L7EndpointsCalculator) ValidateEndpoints ¶ added in v1.23.0
func (l *L7EndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, dupCount int) error
ValidateEndpoints checks if endpoint information is correct.
For L7 Endpoint Calculator, it returns error if one of the two checks fails: 1. The endpoint count from endpointData doesn't equal to the one from endpointPodMap: endpiontPodMap removes the duplicated endpoints, and dupCount stores the number of duplicated it removed and we compare the endpoint counts with duplicates 2. The endpoint count from endpointData or the one from endpointPodMap is 0
type LocalL4ILBEndpointsCalculator ¶ added in v1.9.0
type LocalL4ILBEndpointsCalculator struct {
// contains filtered or unexported fields
}
LocalL4ILBEndpointGetter implements the NetworkEndpointsCalculator interface. It exposes methods to calculate Network endpoints for GCE_VM_IP NEGs when the service uses "ExternalTrafficPolicy: Local" mode. In this mode, the endpoints of the NEG are calculated by listing the nodes that host the service endpoints(pods) for the given service. These candidate nodes picked as is, if the count is less than the subset size limit(250). Otherwise, a subset of nodes is selected. In a cluster with nodes node1... node 50. If nodes node10 to node 45 run the pods for a given ILB service, all these nodes - node10, node 11 ... node45 will be part of the subset.
func NewLocalL4ILBEndpointsCalculator ¶ added in v1.9.0
func NewLocalL4ILBEndpointsCalculator(nodeLister listers.NodeLister, zoneGetter types.ZoneGetter, svcId string, logger klog.Logger) *LocalL4ILBEndpointsCalculator
func (*LocalL4ILBEndpointsCalculator) CalculateEndpoints ¶ added in v1.9.0
func (l *LocalL4ILBEndpointsCalculator) CalculateEndpoints(eds []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, int, error)
CalculateEndpoints determines the endpoints in the NEGs based on the current service endpoints and the current NEGs.
func (*LocalL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode ¶ added in v1.23.0
func (l *LocalL4ILBEndpointsCalculator) CalculateEndpointsDegradedMode(_ []types.EndpointsData, currentMap map[string]types.NetworkEndpointSet) (map[string]types.NetworkEndpointSet, types.EndpointPodMap, error)
func (*LocalL4ILBEndpointsCalculator) Mode ¶ added in v1.9.0
func (l *LocalL4ILBEndpointsCalculator) Mode() types.EndpointsCalculatorMode
Mode indicates the mode that the EndpointsCalculator is operating in.
func (*LocalL4ILBEndpointsCalculator) ValidateEndpoints ¶ added in v1.23.0
func (l *LocalL4ILBEndpointsCalculator) ValidateEndpoints(endpointData []types.EndpointsData, endpointPodMap types.EndpointPodMap, dupCount int) error
type NodeInfo ¶ added in v1.9.0
type NodeInfo struct {
// contains filtered or unexported fields
}
NodeInfo stores node metadata used to sort nodes and pick a subset.
type ZoneInfo ¶ added in v1.9.0
ZoneInfo contains the name and number of nodes for a particular zone. this struct is used for sorting zones according to node count.
type ZoneNetworkEndpointMapResult ¶ added in v1.23.0
type ZoneNetworkEndpointMapResult struct { NetworkEndpointSet map[string]negtypes.NetworkEndpointSet EndpointPodMap negtypes.EndpointPodMap DupCount int }