routing

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadBalancerST = "LoadBalancer"
	ClusterIPST    = "ClusterIP"
	NodePortST     = "NodePort"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Informers added in v2.11.0

type Informers interface {
	Nodes() cache.SharedIndexInformer
	Services() cache.SharedIndexInformer
	EndpointSlices() cache.SharedIndexInformer
}

Informers is the set of shared informers the NRC reads from. We declare it here rather than accepting a full informer factory so that the controller can only reach the resources it actually watches.

type NetworkRoutingController

type NetworkRoutingController struct {
	MetricsEnabled bool

	CNIFirewallSetup *sync.Cond

	NodeEventHandler          cache.ResourceEventHandler
	ServiceEventHandler       cache.ResourceEventHandler
	EndpointSliceEventHandler cache.ResourceEventHandler
	// contains filtered or unexported fields
}

NetworkRoutingController is struct to hold necessary information required by controller

func NewNetworkRoutingController

func NewNetworkRoutingController(clientset kubernetes.Interface,
	kubeRouterConfig *options.KubeRouterConfig,
	informers Informers, ipsetMutex *sync.Mutex,
	ipFilter svcip.Filter,
) (*NetworkRoutingController, error)

NewNetworkRoutingController returns new NetworkRoutingController object

func (*NetworkRoutingController) AddPolicies

func (nrc *NetworkRoutingController) AddPolicies() error

AddPolicies adds BGP import and export policies

func (*NetworkRoutingController) Cleanup

func (nrc *NetworkRoutingController) Cleanup()

Cleanup performs the cleanup of configurations done

func (*NetworkRoutingController) OnEndpointsAdd

func (nrc *NetworkRoutingController) OnEndpointsAdd(obj any)

OnEndpointsAdd handles endpoint add events from apiserver This method calls OnEndpointsUpdate with the addition of updating BGP export policies Calling AddPolicies here covers the edge case where AddPolicies fails in OnServiceUpdate because the corresponding Endpoint resource for the Service was not created yet.

func (*NetworkRoutingController) OnEndpointsUpdate

func (nrc *NetworkRoutingController) OnEndpointsUpdate(obj any)

OnEndpointsUpdate handles the endpoint updates from the kubernetes API server

func (*NetworkRoutingController) OnNodeUpdate

func (nrc *NetworkRoutingController) OnNodeUpdate(_ any)

OnNodeUpdate Handle updates from Node watcher. Node watcher calls this method whenever there is new node is added or old node is deleted. So peer up with new node and drop peering from old node

func (*NetworkRoutingController) OnServiceCreate

func (nrc *NetworkRoutingController) OnServiceCreate(obj any)

OnServiceCreate handles new service create event from the kubernetes API server

func (*NetworkRoutingController) OnServiceDelete

func (nrc *NetworkRoutingController) OnServiceDelete(oldObj any)

OnServiceDelete handles the service delete updates from the kubernetes API server

func (*NetworkRoutingController) OnServiceUpdate

func (nrc *NetworkRoutingController) OnServiceUpdate(objOld any, objNew any)

OnServiceUpdate handles the service relates updates from the kubernetes API server

func (*NetworkRoutingController) Run

func (nrc *NetworkRoutingController) Run(
	healthChan chan<- *healthcheck.ControllerHeartbeat,
	stopCh <-chan struct{},
	wg *sync.WaitGroup,
)

Run runs forever until we are notified on stop channel

type PolicyBasedRouter added in v2.3.0

type PolicyBasedRouter interface {
	Enable() error
	Disable() error
}

PolicyBasedRouting is an interface that defines the methods needed to enable/disable policy based routing

type RouteSyncer added in v2.3.0

type RouteSyncer interface {
	AddInjectedRoute(dst *net.IPNet, route *netlink.Route)
	DelInjectedRoute(dst *net.IPNet)
	Run(
		healthChan chan<- *healthcheck.ControllerHeartbeat,
		stopCh <-chan struct{},
		wg *sync.WaitGroup,
	)
	SyncLocalRouteTable() error
}

RouteSyncer is an interface that defines the methods needed to sync routes to the kernel's routing table

Jump to

Keyboard shortcuts

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