Documentation ¶
Index ¶
- func GetHybridRouteAddrSetDbIDs(nodeName, controller string) *libovsdbops.DbObjectIDs
- type ExternalGatewayMasterController
- func (c *ExternalGatewayMasterController) AddHybridRoutePolicyForPod(podIP net.IP, node string) error
- func (c *ExternalGatewayMasterController) DelAllHybridRoutePolicies() error
- func (c *ExternalGatewayMasterController) DelAllLegacyHybridRoutePolicies() error
- func (c *ExternalGatewayMasterController) DelHybridRoutePolicyForPod(podIP net.IP, node string) error
- func (c *ExternalGatewayMasterController) DeletePodSNAT(nodeName string, extIPs, podIPNets []*net.IPNet) error
- func (c *ExternalGatewayMasterController) GetAPBRoutePolicyStatus(policyName string) (*adminpolicybasedrouteapi.AdminPolicyBasedRouteStatus, error)
- func (c *ExternalGatewayMasterController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)
- func (c *ExternalGatewayMasterController) GetDynamicGatewayIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)
- func (c *ExternalGatewayMasterController) GetStaticGatewayIPsForTargetNamespace(namespaceName string) (sets.Set[string], error)
- func (c *ExternalGatewayMasterController) Repair() error
- func (c *ExternalGatewayMasterController) Run(wg *sync.WaitGroup, threadiness int) error
- type ExternalGatewayNodeController
- type ExternalGatewayRouteInfoCache
- func (e *ExternalGatewayRouteInfoCache) Cleanup(podName ktypes.NamespacedName, f func(routeInfo *RouteInfo) error) error
- func (e *ExternalGatewayRouteInfoCache) CleanupNamespace(nsName string, f func(routeInfo *RouteInfo) error) error
- func (e *ExternalGatewayRouteInfoCache) CreateOrLoad(podName ktypes.NamespacedName, f func(routeInfo *RouteInfo) error) error
- type RouteInfo
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 (c *ExternalGatewayMasterController) GetAPBRoutePolicyStatus(policyName string) (*adminpolicybasedrouteapi.AdminPolicyBasedRouteStatus, error)
func (*ExternalGatewayMasterController) GetAdminPolicyBasedExternalRouteIPsForTargetNamespace ¶
func (*ExternalGatewayMasterController) GetDynamicGatewayIPsForTargetNamespace ¶
func (*ExternalGatewayMasterController) GetStaticGatewayIPsForTargetNamespace ¶
func (*ExternalGatewayMasterController) Repair ¶
func (c *ExternalGatewayMasterController) Repair() 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 ¶
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 }