Documentation ¶
Overview ¶
Package agent contains the libraries that drive the antrea-agent binary. antrea-agent is responsible for the Pod networking and policy implementation on a Kubernetes Node.
Index ¶
- Constants
- func BuildOVSPortExternalIDs(containerConfig *InterfaceConfig) map[string]interface{}
- func CreateAntreaClient(config config.ClientConnectionConfiguration) (versioned.Interface, error)
- type Gateway
- type Initializer
- type InterfaceConfig
- type InterfaceStore
- type InterfaceType
- type NodeConfig
- type OVSPortConfig
Constants ¶
const ( TunPortName = "tun0" NodeNameEnvKey = "NODE_NAME" IPSecPSKEnvKey = "ANTREA_IPSEC_PSK" )
const ( OVSExternalIDMAC = "attached-mac" OVSExternalIDIP = "ip-address" OVSExternalIDContainerID = "container-id" OVSExternalIDPodName = "pod-name" OVSExternalIDPodNamespace = "pod-namespace" )
Variables ¶
This section is empty.
Functions ¶
func BuildOVSPortExternalIDs ¶
func BuildOVSPortExternalIDs(containerConfig *InterfaceConfig) map[string]interface{}
BuildOVSPortExternalIDs parses OVS port external_ids from local cache, it is used to check container configuration
func CreateAntreaClient ¶
func CreateAntreaClient(config config.ClientConnectionConfiguration) (versioned.Interface, error)
CreateAntreaClient creates an Antrea client from the given config.
Types ¶
type Initializer ¶
type Initializer struct { MTU int // contains filtered or unexported fields }
Initializer knows how to setup host networking, OpenVSwitch, and Openflow.
func NewInitializer ¶
func NewInitializer( ovsBridgeClient ovsconfig.OVSBridgeClient, ofClient openflow.Client, k8sClient clientset.Interface, ifaceStore InterfaceStore, ovsBridge, serviceCIDR, hostGateway, tunnelType string, MTU int, enableIPSecTunnel bool) *Initializer
func (*Initializer) GetIPSecPSK ¶
func (i *Initializer) GetIPSecPSK() string
GetIPSecPSK returns PSK used for IPSec tunnel.
func (*Initializer) GetNodeConfig ¶
func (i *Initializer) GetNodeConfig() *NodeConfig
GetNodeConfig returns the NodeConfig.
func (*Initializer) Initialize ¶
func (i *Initializer) Initialize() error
type InterfaceConfig ¶
type InterfaceConfig struct { ID string Type InterfaceType IP net.IP MAC net.HardwareAddr PodName string PodNamespace string NetNS string *OVSPortConfig }
func NewContainerInterface ¶
func NewContainerInterface(containerID string, podName string, podNamespace string, containerNetNS string, mac net.HardwareAddr, ip net.IP) *InterfaceConfig
NewContainerInterface creates container interface configuration
func NewGatewayInterface ¶
func NewGatewayInterface(gatewayName string) *InterfaceConfig
NewGatewayInterface creates host gateway interface configuration
func NewTunnelInterface ¶
func NewTunnelInterface(tunnelName string) *InterfaceConfig
NewTunnelInterface creates tunnel port interface configuration
type InterfaceStore ¶
type InterfaceStore interface { Initialize(ovsBridgeClient ovsconfig.OVSBridgeClient, gatewayPort string, tunnelPort string) error AddInterface(ifaceID string, interfaceConfig *InterfaceConfig) DeleteInterface(ifaceID string) GetInterface(ifaceID string) (*InterfaceConfig, bool) GetContainerInterface(podName string, podNamespace string) (*InterfaceConfig, bool) GetContainerInterfaceNum() int Len() int GetInterfaceIDs() []string }
InterfaceStore is a service interface to create local interfaces for container, host gateway, and tunnel port. Support add/delete/get operations
func NewInterfaceStore ¶
func NewInterfaceStore() InterfaceStore
type InterfaceType ¶
type InterfaceType uint8
const ( // ContainerInterface is used to mark current interface is for container ContainerInterface InterfaceType = iota // GatewayInterface is used to mark current interface is for host gateway GatewayInterface // TunnelInterface is used to mark current interface is for tunnel port TunnelInterface )
type OVSPortConfig ¶
Directories ¶
Path | Synopsis |
---|---|
ipam/testing
Package testing is a generated GoMock package.
|
Package testing is a generated GoMock package. |
controller
|
|
testing
Package testing is a generated GoMock package.
|
Package testing is a generated GoMock package. |