Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayInfo ¶
GatewayInfo is a set of destination networks for a gateway.
type PodNetConf ¶
type PodNetConf struct { PoolName string ContainerId string IFace string IPv4 net.IP IPv6 net.IP HostVethName string }
PodNetConf holds configuration parameters for a Pod network
type PodNetwork ¶
type PodNetwork interface { // Init initializes the host network. Init() error // Setup connects the host network and the container network with a veth pair. // `nsPath` is the container network namespace's (possibly bind-mounted) file. // If `hook` is non-nil, it is called in the Pod network. Setup(nsPath, podName, podNS string, conf *PodNetConf, hook SetupHook) (*current.Result, error) // Update updates the container network configuration // Currently, it only updates configuration using a SetupHook, e.g. NAT setting Update(podIPv4, podIPv6 net.IP, hook SetupHook) error // Check checks the pod network's status. Check(containerId, iface string) error // Destroy disconnects the container network by deleting the veth pair. // IPv4 and IPv6 in conf can be left nil. Destroy(containerId, iface string) error // List returns a list of already setup network configurations. List() ([]*PodNetConf, error) }
PodNetwork represents an interface to configure container networking.
func NewPodNetwork ¶
func NewPodNetwork(podTableID, podRulePrio, protocolId int, hostIPv4, hostIPv6 net.IP, compatCalico, registerFromMain bool, log logr.Logger) PodNetwork
NewPodNetwork creates a PodNetwork
type RouteExporter ¶
RouteExporter exports subnets to a Linux kernel routing table.
func NewRouteExporter ¶
func NewRouteExporter(tableId, protocolId int, log logr.Logger) RouteExporter
NewRouteExporter creates a new RouteExporter
type RouteSyncer ¶
type RouteSyncer interface { // Sync synchronizes the kernel routing table with the given routes. Sync([]GatewayInfo) error }
RouteSyncer is the interface to program direct routing.
func NewRouteSyncer ¶
func NewRouteSyncer(protocolId int, log logr.Logger) RouteSyncer
NewRouteSyncer creates a DirectRouter that marks routes with protocolId.
protocolId must be different from the ID for NewPodNetwork.
Click to show internal directories.
Click to hide internal directories.