config

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTunPortName = "tun0"
	// Invalid ofport_request number is in range 1 to 65,279. For ofport_request number not in the range, OVS
	// ignore the it and automatically assign a port number.
	// Here we use an invalid port number "0" to request for automatically port allocation.
	AutoAssignedOFPort = 0
	DefaultTunOFPort   = 1
	HostGatewayOFPort  = 2
	UplinkOFPort       = 3
	// 0xfffffffe is a reserved port number in OpenFlow protocol, which is dedicated for the Bridge interface.
	BridgeOFPort = 0xfffffffe
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterNetConfig added in v0.7.0

type AdapterNetConfig struct {
	Name       string
	Index      int
	MAC        net.HardwareAddr
	IP         *net.IPNet
	Gateway    string
	DNSServers string
}

type GatewayConfig

type GatewayConfig struct {
	IP  net.IP
	MAC net.HardwareAddr
	// LinkIndex is the link index of host gateway.
	LinkIndex int
	// Name is the name of host gateway, e.g. gw0.
	Name string
}

func (*GatewayConfig) String

func (g *GatewayConfig) String() string

type NetworkConfig

type NetworkConfig struct {
	TrafficEncapMode  TrafficEncapModeType
	TunnelType        ovsconfig.TunnelType
	EnableIPSecTunnel bool
	IPSecPSK          string
}

User provided network configuration parameters.

type NodeConfig

type NodeConfig struct {
	// The Node's name used in Kubernetes.
	Name string
	// The name of the OpenVSwitch bridge antrea-agent uses.
	OVSBridge string
	// The CIDR block to allocate Pod IPs out of.
	// It's nil for the networkPolicyOnly trafficEncapMode which doesn't do IPAM.
	PodCIDR *net.IPNet
	// The Node's IP used in Kubernetes. It has the network mask information.
	NodeIPAddr *net.IPNet
	// The config of the gateway network device, i.e. gw0 by default.
	GatewayConfig   *GatewayConfig
	UplinkNetConfig *AdapterNetConfig
}

Local Node configurations retrieved from K8s API or host networking state.

func (*NodeConfig) String

func (n *NodeConfig) String() string

type TrafficEncapModeType

type TrafficEncapModeType int
const (
	TrafficEncapModeEncap TrafficEncapModeType = iota
	TrafficEncapModeNoEncap
	TrafficEncapModeHybrid
	TrafficEncapModeNetworkPolicyOnly
	TrafficEncapModeInvalid = -1
)

func GetTrafficEncapModeFromStr

func GetTrafficEncapModeFromStr(str string) (bool, TrafficEncapModeType)

GetTrafficEncapModeFromStr returns true and TrafficEncapModeType corresponding to input string. Otherwise, false and undefined value is returned

func GetTrafficEncapModes

func GetTrafficEncapModes() []TrafficEncapModeType

func (TrafficEncapModeType) IsNetworkPolicyOnly added in v0.5.0

func (m TrafficEncapModeType) IsNetworkPolicyOnly() bool

IsNetworkPolicyOnly returns true if TrafficEncapModeType is network policy only.

func (TrafficEncapModeType) NeedsEncapToPeer

func (m TrafficEncapModeType) NeedsEncapToPeer(peerIP net.IP, localIP *net.IPNet) bool

NeedsEncapToPeer returns true if Pod traffic to peer Node needs to be encapsulated.

func (TrafficEncapModeType) NeedsRoutingToPeer

func (m TrafficEncapModeType) NeedsRoutingToPeer(peerIP net.IP, localIP *net.IPNet) bool

NeedsRoutingToPeer returns true if Pod traffic to peer Node needs underlying routing support.

func (TrafficEncapModeType) String

func (m TrafficEncapModeType) String() string

String returns value in string.

func (TrafficEncapModeType) SupportsEncap

func (m TrafficEncapModeType) SupportsEncap() bool

SupportsEncap returns true if TrafficEncapModeType supports encap.

func (TrafficEncapModeType) SupportsNoEncap

func (m TrafficEncapModeType) SupportsNoEncap() bool

SupportsNoEncap returns true if TrafficEncapModeType supports noEncap.

Jump to

Keyboard shortcuts

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