routes

package
v2.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// CustomTableID is the ID of the custom, iproute2 routing table that will be used for policy based routing
	CustomTableID = "77"
	// CustomTableName is the name of the custom, iproute2 routing table that will be used for policy based routing
	CustomTableName = "kube-router"
)

Variables

This section is empty.

Functions

func DeleteByDestination

func DeleteByDestination(destinationSubnet *net.IPNet) error

DeleteByDestination attempts to safely find all routes based upon its destination subnet and delete them

Types

type PolicyBasedRules

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

PolicyBasedRules is a struct that holds all of the information needed for manipulating policy based routing rules

func NewPolicyBasedRules

func NewPolicyBasedRules(nfa utils.NodeFamilyAware, podIPv4CIDRs, podIPv6CIDRs []string) *PolicyBasedRules

NewPolicyBasedRules creates a new PBR object which will be used to manipulate policy based routing rules

func (*PolicyBasedRules) Disable

func (pbr *PolicyBasedRules) Disable() error

Disable removes the custom routing table that was used for policy based routing

func (*PolicyBasedRules) Enable

func (pbr *PolicyBasedRules) Enable() error

Enable setup a custom routing table that will be used for policy based routing to ensure traffic originating on tunnel interface only leaves through tunnel interface irrespective rp_filter enabled/disabled

type RouteSync

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

RouteSync is a struct that holds all of the information needed for syncing routes to the kernel's routing table

func NewRouteSyncer

func NewRouteSyncer(syncPeriod time.Duration, registerMetrics bool) *RouteSync

NewRouteSyncer creates a new routeSyncer that, when run, will sync routes kept in its local state table every syncPeriod

func (*RouteSync) AddInjectedRoute

func (rs *RouteSync) AddInjectedRoute(dst *net.IPNet, route *netlink.Route)

addInjectedRoute adds a route to the route map that is regularly synced to the kernel's routing table

func (*RouteSync) DelInjectedRoute

func (rs *RouteSync) DelInjectedRoute(dst *net.IPNet)

delInjectedRoute delete a route from the route map that is regularly synced to the kernel's routing table

func (*RouteSync) Run

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

run starts a goroutine that calls syncLocalRouteTable on interval injectedRoutesSyncPeriod

func (*RouteSync) SyncLocalRouteTable

func (rs *RouteSync) SyncLocalRouteTable() error

syncLocalRouteTable iterates over the local route state map and syncs all routes to the kernel's routing table

type RouteSyncErr

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

func (RouteSyncErr) Error

func (rse RouteSyncErr) Error() string

Jump to

Keyboard shortcuts

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