cnidel

package
v3.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: BSD-3-Clause Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LegacyNamingScheme = "legacy"
)

Variables

This section is empty.

Functions

func CalculateIfaceName

func CalculateIfaceName(namingScheme, chosenName, defaultName string, sequenceId int) string

CalculateIfaceName decides what should be the name of a container's interface. If a name is explicitly set in the related DanmNet API object, the NIC will be named accordingly. If a name is not explicitly set, then DANM will name the interface ethX where X=sequence number of the interface When legacy naming scheme is configured container_prefix behaves as the exact name of an interface, rather than its name suggest

func DelegateInterfaceDelete

func DelegateInterfaceDelete(netConf *datastructs.NetConf, danmClient danmclientset.Interface, netInfo *danmtypes.DanmNet, ep *danmtypes.DanmEp) error

DelegateInterfaceDelete delegates Ks8 Pod network interface delete task to the input 3rd party CNI plugin Returns an error if interface creation was unsuccessful, or if the 3rd party CNI config could not be loaded

func DelegateInterfaceSetup

func DelegateInterfaceSetup(netConf *datastructs.NetConf, danmClient danmclientset.Interface, netInfo *danmtypes.DanmNet, ep *danmtypes.DanmEp) (*current.Result, error)

DelegateInterfaceSetup delegates K8s Pod network interface setup task to the input 3rd party CNI plugin Returns the CNI compatible result object, or an error if interface creation was unsuccessful, or if the 3rd party CNI config could not be loaded

func GetEnv

func GetEnv(key, fallback string) string

func IsDelegationRequired

func IsDelegationRequired(danmClient danmclientset.Interface, nid, namespace string) (bool, *danmtypes.DanmNet, error)

IsDelegationRequired decides if the interface creation operations should be delegated to a 3rd party CNI, or can be handled by DANM Decision is made based on the NetworkType parameter of the DanmNet object

func IsDeviceNeeded

func IsDeviceNeeded(cniType string) bool

Types

type MacvlanNet

type MacvlanNet struct {
	types.NetConf
	//Name of the master NIC the MACVLAN slave needs to be connected to
	Master string `json:"master"`
	//The mode in which the MACVLAN slave is configured (default bridge)
	Mode string `json:"mode"`
	//MTU to be set to the MACVLAN slave interface (default 1500)
	MTU int `json:"mtu"`
	//IPAM configuration to be used for this network
	Ipam danmtypes.IpamConfig `json:"ipam,omitEmpty"`
}

type SriovNet

type SriovNet struct {
	types.NetConf
	// name of the PF since sriov cni v1.0.0
	PfName string `json:"master"`
	// if true then add VF as L2 mode only, IPAM will not be executed
	L2Mode bool `json:"l2enable,omitEmpty"`
	// VLAN ID to assign for the VF
	Vlan int `json:"vlan,omitEmpty"`
	// IPAM configuration to be used for this network
	Ipam danmtypes.IpamConfig `json:"ipam,omitEmpty"`
	// Device PCI ID
	DeviceID string `json:"deviceID"`
}

sriovNet represent the configuration of sriov cni v1.0.0

type VfInformation

type VfInformation struct {
	PCIaddr string `json:"pci_addr"`
	Pfname  string `json:"pfname"`
	Vfid    int    `json:"vfid"`
}

VfInformation is a DeviceInfo descriptor expected by sriov cni v1.0.0

Jump to

Keyboard shortcuts

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