Documentation ¶
Index ¶
Constants ¶
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" )
const (
// Taken from: https://github.com/torvalds/linux/blob/master/include/uapi/linux/rtnetlink.h#L284
ZebraOriginator = 0x11
)
Variables ¶
This section is empty.
Functions ¶
func DeleteByDestination ¶
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 ¶
NewRouteSyncer creates a new routeSyncer that, when run, will sync routes kept in its local state table every syncPeriod
func (*RouteSync) AddInjectedRoute ¶
addInjectedRoute adds a route to the route map that is regularly synced to the kernel's routing table
func (*RouteSync) DelInjectedRoute ¶
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 ¶
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