apbroute

package
v0.0.0-...-d8d42f1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHybridRouteAddrSetDbIDs

func GetHybridRouteAddrSetDbIDs(nodeName, controller string) *libovsdbops.DbObjectIDs

Types

type ExternalGatewayMasterController

type ExternalGatewayMasterController struct {
	ExternalGWRouteInfoCache *ExternalGatewayRouteInfoCache
	// contains filtered or unexported fields
}

func NewExternalMasterController

func NewExternalMasterController(
	apbRoutePolicyClient adminpolicybasedrouteclient.Interface,
	stopCh <-chan struct{},
	podInformer coreinformers.PodInformer,
	namespaceInformer coreinformers.NamespaceInformer,
	apbRouteInformer adminpolicybasedrouteinformer.AdminPolicyBasedExternalRouteInformer,
	nodeLister corev1listers.NodeLister,
	nbClient libovsdbclient.Client,
	addressSetFactory addressset.AddressSetFactory,
	controllerName string,
	zoneID string,
) (*ExternalGatewayMasterController, error)

func (*ExternalGatewayMasterController) AddHybridRoutePolicyForPod

func (c *ExternalGatewayMasterController) AddHybridRoutePolicyForPod(podIP net.IP, node string) error

AddHybridRoutePolicyForPod exposes the function addHybridRoutePolicyForPod

func (*ExternalGatewayMasterController) DelAllHybridRoutePolicies

func (c *ExternalGatewayMasterController) DelAllHybridRoutePolicies() error

DelAllHybridRoutePolicies exposes the function delAllHybridRoutePolicies

func (*ExternalGatewayMasterController) DelAllLegacyHybridRoutePolicies

func (c *ExternalGatewayMasterController) DelAllLegacyHybridRoutePolicies() error

DelAllLegacyHybridRoutePolicies exposes the function delAllLegacyHybridRoutePolicies

func (*ExternalGatewayMasterController) DelHybridRoutePolicyForPod

func (c *ExternalGatewayMasterController) DelHybridRoutePolicyForPod(podIP net.IP, node string) error

DelHybridRoutePolicyForPod exposes the function delHybridRoutePolicyForPod

func (*ExternalGatewayMasterController) DeletePodSNAT

func (c *ExternalGatewayMasterController) DeletePodSNAT(nodeName string, extIPs, podIPNets []*net.IPNet) error

DeletePodSNAT exposes the function deletePodSNAT

func (*ExternalGatewayMasterController) GetAPBRoutePolicyStatus

func (*ExternalGatewayMasterController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace

func (c *ExternalGatewayMasterController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)

func (*ExternalGatewayMasterController) GetDynamicGatewayIPsForTargetNamespace

func (c *ExternalGatewayMasterController) GetDynamicGatewayIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)

func (*ExternalGatewayMasterController) GetStaticGatewayIPsForTargetNamespace

func (c *ExternalGatewayMasterController) GetStaticGatewayIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)

func (*ExternalGatewayMasterController) Repair

func (*ExternalGatewayMasterController) Run

func (c *ExternalGatewayMasterController) Run(wg *sync.WaitGroup, threadiness int) error

type ExternalGatewayNodeController

type ExternalGatewayNodeController struct {
	// contains filtered or unexported fields
}

func NewExternalNodeController

func NewExternalNodeController(
	podInformer coreinformers.PodInformer,
	namespaceInformer coreinformers.NamespaceInformer,
	apbRouteInformer adminpolicybasedrouteinformer.AdminPolicyBasedExternalRouteInformer,
	stopCh <-chan struct{},
) (*ExternalGatewayNodeController, error)

func (*ExternalGatewayNodeController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace

func (c *ExternalGatewayNodeController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)

func (*ExternalGatewayNodeController) Run

func (c *ExternalGatewayNodeController) Run(wg *sync.WaitGroup, threadiness int) error

type ExternalGatewayRouteInfoCache

type ExternalGatewayRouteInfoCache struct {
	// contains filtered or unexported fields
}

func NewExternalGatewayRouteInfoCache

func NewExternalGatewayRouteInfoCache() *ExternalGatewayRouteInfoCache

func (*ExternalGatewayRouteInfoCache) Cleanup

func (e *ExternalGatewayRouteInfoCache) Cleanup(podName ktypes.NamespacedName, f func(routeInfo *RouteInfo) error) error

Cleanup will lock the key `podName` and use the routeInfo associated to the key to pass it as an argument to function `f`. After the function `f` completes, it will delete any empty PodExternalRoutes references for each given podIP in the routeInfo object, as well as deleting the key itself if it contains no entries in its `PodExternalRoutes` map.

func (*ExternalGatewayRouteInfoCache) CleanupNamespace

func (e *ExternalGatewayRouteInfoCache) CleanupNamespace(nsName string, f func(routeInfo *RouteInfo) error) error

CleanupNamespace wraps the cleanup call for all the pods in a given namespace. The routeInfo reference for each pod in the given namespace is processed by the `f` function inside the `Cleanup` function

func (*ExternalGatewayRouteInfoCache) CreateOrLoad

func (e *ExternalGatewayRouteInfoCache) CreateOrLoad(podName ktypes.NamespacedName, f func(routeInfo *RouteInfo) error) error

CreateOrLoad provides a mechanism to initialize keys in the cache before calling the argument function `f`. This approach hides the logic to initialize and retrieval of the key's routeInfo and allows reusability by exposing a function signature as argument that has a routeInfo instance as argument. The function will attempt to retrieve the routeInfo for a given key, and create an empty routeInfo structure in the cache when not found. Then it will execute the function argument `f` passing the routeInfo as argument.

type RouteInfo

type RouteInfo struct {
	PodName ktypes.NamespacedName
	// PodExternalRoutes is a cache keeping the LR routes added to the GRs when
	// external gateways are used. The first map key is the podIP (src-ip of the route),
	// the second the GW IP (next hop), and the third the GR name
	PodExternalRoutes map[string]map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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