syncers

package
v1.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 42 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MAX_NETWORK_ENDPOINTS_PER_BATCH = 500
)

Variables

This section is empty.

Functions

func GetEndpointsCalculator added in v1.9.0

func GetEndpointsCalculator(podLister, nodeLister, serviceLister cache.Indexer, zoneGetter *zonegetter.ZoneGetter, syncerKey negtypes.NegSyncerKey, mode negtypes.EndpointsCalculatorMode, logger klog.Logger, enableDualStackNEG bool, syncMetricsCollector *metricscollector.SyncerMetrics, networkInfo *network.NetworkInfo) negtypes.NetworkEndpointsCalculator

func NewTransactionSyncer added in v1.5.0

func NewTransactionSyncer(
	negSyncerKey negtypes.NegSyncerKey,
	recorder record.EventRecorder,
	cloud negtypes.NetworkEndpointGroupCloud,
	zoneGetter *zonegetter.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,
	networkInfo network.NetworkInfo,
) 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 *zonegetter.ZoneGetter, svcId string, logger klog.Logger, networkInfo *network.NetworkInfo) *ClusterL4ILBEndpointsCalculator

func (*ClusterL4ILBEndpointsCalculator) CalculateEndpoints added in v1.9.0

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 (*ClusterL4ILBEndpointsCalculator) Mode added in v1.9.0

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 *zonegetter.ZoneGetter, podLister, nodeLister, serviceLister cache.Indexer, syncerKey types.NegSyncerKey, logger klog.Logger, enableDualStackNEG bool, syncMetricsCollector *metricscollector.SyncerMetrics) *L7EndpointsCalculator

func (*L7EndpointsCalculator) CalculateEndpoints added in v1.9.0

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

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

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 *zonegetter.ZoneGetter, svcId string, logger klog.Logger, networkInfo *network.NetworkInfo) *LocalL4ILBEndpointsCalculator

func (*LocalL4ILBEndpointsCalculator) CalculateEndpoints added in v1.9.0

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 (*LocalL4ILBEndpointsCalculator) Mode added in v1.9.0

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

type ZoneInfo struct {
	Name      string
	NodeCount int
}

ZoneInfo contains the name and number of nodes for a particular zone. this struct is used for sorting zones according to node count.

func (ZoneInfo) String added in v1.9.0

func (z ZoneInfo) String() string

type ZoneNetworkEndpointMapResult added in v1.23.0

type ZoneNetworkEndpointMapResult struct {
	NetworkEndpointSet map[string]negtypes.NetworkEndpointSet
	EndpointPodMap     negtypes.EndpointPodMap
	EPCount            negtypes.StateCountMap
	EPSCount           negtypes.StateCountMap
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL