route

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(serviceCIDR *net.IPNet, networkConfig *config.NetworkConfig, noSNAT bool) (*Client, error)

NewClient returns a route client. Todo: remove param serviceCIDR after kube-proxy is replaced by Antrea Proxy completely.

func (*Client) AddRoutes

func (c *Client) AddRoutes(podCIDR *net.IPNet, nodeName string, peerNodeIP, peerGwIP net.IP) error

AddRoutes adds routes to the provided podCIDR. It overrides the routes if they already exist, without error.

func (*Client) AddSNATRule

func (c *Client) AddSNATRule(snatIP net.IP, mark uint32) error

func (*Client) DeleteRoutes

func (c *Client) DeleteRoutes(podCIDR *net.IPNet) error

DeleteRoutes deletes routes to the provided podCIDR. It does nothing if the routes don't exist, without error.

func (*Client) DeleteSNATRule

func (c *Client) DeleteSNATRule(mark uint32) error

func (*Client) Initialize

func (c *Client) Initialize(nodeConfig *config.NodeConfig, done func()) error

Initialize sets nodeConfig on Window. Service LoadBalancing is provided by OpenFlow.

func (*Client) MigrateRoutesToGw

func (c *Client) MigrateRoutesToGw(linkName string) error

MigrateRoutesToGw is not supported on Windows.

func (*Client) Reconcile

func (c *Client) Reconcile(podCIDRs []string) error

Reconcile removes the orphaned routes and related configuration based on the desired podCIDRs. Only the route entries on the host gateway interface are stored in the cache.

func (*Client) Run

func (c *Client) Run(stopCh <-chan struct{})

Run is not supported on Windows and returns immediately.

func (*Client) UnMigrateRoutesFromGw

func (c *Client) UnMigrateRoutesFromGw(route *net.IPNet, linkName string) error

UnMigrateRoutesFromGw is not supported on Windows.

type Interface

type Interface interface {
	// Initialize should initialize all infrastructures required to route container packets in host network.
	// It should be idempotent and can be safely called on every startup.
	Initialize(nodeConfig *config.NodeConfig, done func()) error

	// Reconcile should remove orphaned routes and related configuration based on the desired podCIDRs. If IPv6 is enabled
	// in the cluster, Reconcile should also remove the orphaned IPv6 neighbors.
	Reconcile(podCIDRs []string) error

	// AddRoutes should add routes to the provided podCIDR.
	// It should override the routes if they already exist, without error.
	AddRoutes(podCIDR *net.IPNet, peerNodeName string, peerNodeIP, peerGwIP net.IP) error

	// DeleteRoutes should delete routes to the provided podCIDR.
	// It should do nothing if the routes don't exist, without error.
	DeleteRoutes(podCIDR *net.IPNet) error

	// MigrateRoutesToGw should move routes from device linkname to local gateway.
	MigrateRoutesToGw(linkName string) error

	// UnMigrateRoutesFromGw should move routes back from local gateway to original device linkName
	// if linkName is nil, it should remove the routes.
	UnMigrateRoutesFromGw(route *net.IPNet, linkName string) error

	// AddSNATRule should add rule to SNAT outgoing traffic with the mark, using the provided SNAT IP.
	AddSNATRule(snatIP net.IP, mark uint32) error

	// DeleteSNATRule should delete rule to SNAT outgoing traffic with the mark.
	DeleteSNATRule(mark uint32) error

	// Run starts the sync loop.
	Run(stopCh <-chan struct{})
}

Interface is the interface for routing container packets in host network.

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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