Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AddRoutes(podCIDR *net.IPNet, nodeIP, nodeGwIP net.IP) error
- func (c *Client) DeleteRoutes(podCIDR *net.IPNet) error
- func (c *Client) Initialize(nodeConfig *config.NodeConfig) error
- func (c *Client) MigrateRoutesToGw(linkName string) error
- func (c *Client) Reconcile(podCIDRs []string) error
- func (c *Client) UnMigrateRoutesFromGw(route *net.IPNet, linkName string) error
- type Interface
Constants ¶
View Source
const ( // AntreaServiceTable is route table name for Antrea service traffic. AntreaServiceTable = "Antrea-service" // AntreaServiceTableIdx is route table index for Antrea service traffic. AntreaServiceTableIdx = 300 // AntreaIPRulePriority is Antrea IP rule priority AntreaIPRulePriority = 300 )
Variables ¶
View Source
var (
// RtTblSelectorValue selects which route table to use to forward service traffic back to host gateway antrea-gw0.
RtTblSelectorValue = 1 << 11
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client takes care of routing container packets in host network, coordinating ip route, ip rule, iptables and ipset.
func (*Client) AddRoutes ¶ added in v0.5.0
AddRoutes adds routes to a new podCIDR. It overrides the routes if they already exist.
func (*Client) DeleteRoutes ¶ added in v0.5.0
DeleteRoutes deletes routes to a PodCIDR. It does nothing if the routes doesn't exist.
func (*Client) Initialize ¶
func (c *Client) Initialize(nodeConfig *config.NodeConfig) error
Initialize initializes all infrastructures required to route container packets in host network. It is idempotent and can be safely called on every startup.
func (*Client) MigrateRoutesToGw ¶ added in v0.5.0
MigrateRoutesToGw moves routes (including assigned IP addresses if any) from link linkName to host gateway.
type Interface ¶ added in v0.5.0
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) error // Reconcile should remove orphaned routes and related configuration based on the desired podCIDRs. 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, 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 }
Interface is the interface for routing container packets in host network.
Click to show internal directories.
Click to hide internal directories.