types

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VlanStripTypeFilter = "filter"
	VlanStripTypeVlan   = "vlan"
)

how datapath handle vlan

Variables

This section is empty.

Functions

This section is empty.

Types

type CNIConf

type CNIConf struct {
	cniTypes.NetConf

	// HostVethPrefix is the veth for container prefix on host
	HostVethPrefix string `json:"veth_prefix"`

	// eniIPVirtualType is the ipvlan for container
	ENIIPVirtualType string `json:"eniip_virtual_type"`

	// HostStackCIDRs is a list of CIDRs, all traffic targeting these CIDRs will be redirected to host network stack
	HostStackCIDRs []string `json:"host_stack_cidrs"`

	DisableHostPeer bool `yaml:"disable_host_peer" json:"disable_host_peer"` // disable create peer for host and container. This will also disable ability for service

	VlanStripType VlanStripType `yaml:"vlan_strip_type" json:"vlan_strip_type"` // used in multi ip mode, how datapath config vlan

	// MTU is container and ENI network interface MTU
	MTU int `json:"mtu"`

	// RuntimeConfig represents the options to be passed in by the runtime.
	RuntimeConfig cni.RuntimeConfig `json:"runtimeConfig"`

	BandwidthMode string `json:"bandwidth_mode"`

	// EnableNetworkPriority by enable priority control, eni qdisc is replaced with tc_prio
	EnableNetworkPriority bool `json:"enable_network_priority"`

	// Debug
	Debug bool `json:"debug"`
}

CNIConf is the cni network config

func (*CNIConf) IPVlan

func (n *CNIConf) IPVlan() bool

type CheckConfig

type CheckConfig struct {
	DP DataPath

	RecordPodEvent

	NetNS ns.NetNS

	HostVETHName    string
	ContainerIfName string

	ContainerIPNet *terwayTypes.IPNetSet
	HostIPSet      *terwayTypes.IPNetSet
	GatewayIP      *terwayTypes.IPSet

	ENIIndex int32 // phy device
	TrunkENI bool
	MTU      int

	DefaultRoute bool
	MultiNetwork bool
}

type DataPath

type DataPath int
const (
	VPCRoute DataPath = iota
	PolicyRoute
	IPVlan
	ExclusiveENI
	Vlan
)

datapath terway supported

type K8SArgs

type K8SArgs struct {
	cniTypes.CommonArgs
	IP                         net.IP
	K8S_POD_NAME               cniTypes.UnmarshallableString // nolint
	K8S_POD_NAMESPACE          cniTypes.UnmarshallableString // nolint
	K8S_POD_INFRA_CONTAINER_ID cniTypes.UnmarshallableString // nolint
}

K8SArgs is cni args of kubernetes

type RecordPodEvent

type RecordPodEvent func(msg string)

type SetupConfig

type SetupConfig struct {
	DP DataPath

	HostVETHName string

	ContainerIfName string
	ContainerIPNet  *terwayTypes.IPNetSet
	GatewayIP       *terwayTypes.IPSet
	MTU             int
	ENIIndex        int
	ENIGatewayIP    *terwayTypes.IPSet

	// disable create peer for exclusiveENI
	DisableCreatePeer bool

	// StripVlan or use vlan
	StripVlan bool
	Vid       int

	DefaultRoute bool
	MultiNetwork bool

	// add extra route in container
	ExtraRoutes []cniTypes.Route

	ServiceCIDR *terwayTypes.IPNetSet
	HostIPSet   *terwayTypes.IPNetSet
	// ipvlan
	HostStackCIDRs []*net.IPNet

	BandwidthMode string
	Ingress       uint64
	Egress        uint64

	EnableNetworkPriority bool
	NetworkPriority       uint32

	RuntimeConfig cni.RuntimeConfig

	// for windows
	AssistantContainerIPNet *terwayTypes.IPNetSet
	AssistantGatewayIP      *terwayTypes.IPSet
}

type TeardownCfg

type TeardownCfg struct {
	DP DataPath

	HostVETHName string

	ENIIndex int

	ContainerIfName string
	ContainerIPNet  *terwayTypes.IPNetSet

	ServiceCIDR *terwayTypes.IPNetSet

	EnableNetworkPriority bool
}

type VlanStripType

type VlanStripType string

VlanStripType how datapath handle vlan

Jump to

Keyboard shortcuts

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