Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CelloChainer is the type of CNI conflist for chained CNI call. CelloChainer = "cello-chainer" // NetworkInterfaceConfigTypeTrunk is the trunk type of NetworkInterfaceConfig runtimeConfig NetworkInterfaceConfigTypeTrunk = "trunk" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthEntry ¶
type BandwidthEntry struct {
IngressRate int `json:"ingressRate"`
IngressBurst int `json:"ingressBurst"`
EgressRate int `json:"egressRate"`
EgressBurst int `json:"egressBurst"`
}
BandwidthEntry for CNI BandwidthEntry
func (*BandwidthEntry) IsZero ¶
func (bw *BandwidthEntry) IsZero() bool
type DataPathType ¶
type DataPathType int
DataPathType is the interface type of pod.
const ( IPVlan DataPathType = iota ENI Vlan )
type K8SArgs ¶
type K8SArgs struct {
types.CommonArgs
K8S_POD_NAME types.UnmarshallableString // nolint
K8S_POD_NAMESPACE types.UnmarshallableString // nolint
K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString // nolint
K8S_POD_UID types.UnmarshallableString // nolint
}
K8SArgs is CNI args of kubernetes.
type NetConf ¶
type NetConf struct {
// CNIVersion for CNI calls.
CNIVersion string `json:"cniVersion,omitempty"`
// Name is the name of netconf.
Name string `json:"name"`
// Type is CNI type, should be cello.
Type string `json:"type"`
// RedirectToHostCIDRs, all traffic targeting these CIDRs will be redirected to host.
RedirectToHostCIDRs []string `json:"redirectToHostCIDRs"`
// LocalFastPath is a switch to determine weather cello should set up fast path between host and pod.
// Currently only support IPVlan and Vlan (by adding additional veth pair) driver.
LocalFastPath bool `json:"localFastPath"`
// runtime config, support all dynamic config from meta and other runtimes
RuntimeConfig struct {
NetworkInterfaceConfig *NetworkInterfaceConfig `json:"com.volcengine.k8s.network-interface,omitempty"`
Bandwidth *BandwidthEntry `json:"bandwidth,omitempty"`
} `json:"runtimeConfig,omitempty"`
}
NetConf is the cni network config.
type NetworkInterfaceConfig ¶
type NetworkInterfaceConfig struct {
Type string `json:"type"`
IPs []*cniIp.IP `json:"ips,omitempty"`
Mac string `json:"mac,omitempty"`
Trunk *NetworkInterfaceTrunkConfig `json:"trunk,omitempty"`
}
NetworkInterfaceConfig describes network interface configs used by cello CNI.
type NetworkInterfaceTrunkConfig ¶
type NetworkInterfaceTrunkConfig struct {
VlanID string `json:"vlanID,omitempty"`
TrunkMac string `json:"trunkMac,omitempty"`
}
NetworkInterfaceTrunkConfig is the branch ENI information used by Vlan driver.
type ResourceClient ¶
type ResourceClient interface {
// GetPodResourceMap returns an instance of a map of Pod ResourceInfo given a (Pod name, namespace) tuple.
GetPodResourceMap(podNamespace, podName string) (map[string]*ResourceInfo, error)
}
ResourceClient provides a kubelet Pod resource handle.
type ResourceInfo ¶
ResourceInfo is struct to hold Pod device allocation information.
type SetupConfig ¶
type SetupConfig struct {
DP DataPathType
ENIIndex int
IfName string //interface Name in pod
Link netlink.Link //pod's interface
NetNSPath string //ns path of pod
NetNs *ns.NetNS
IPv4 *net.IPNet
IPv4Gateway net.IP
IPv6 *net.IPNet
IPv6Gateway net.IP
BandWidth *BandwidthEntry
DefaultRoute bool
ExtraRoutes []types.Route
PolicyRoute bool
RedirectToHostCIDRs []*net.IPNet // used by nodeLocalDns etc.
LocalFastPath bool
VethNameInHost string
HostLink netlink.Link // host master, eth0
HostIPSet *celloTypes.IPSet
// for vlan
Vid uint32
HardwareAddr net.HardwareAddr
}
SetupConfig is the datapath config for pod to be set up.
func (*SetupConfig) String ¶
func (c *SetupConfig) String() string
type TeardownConfig ¶
type TeardownConfig struct {
DP DataPathType
ContainerIPNet *celloTypes.IPSet
}
TeardownConfig is the datapath config for cello-cni to teardown.
func (*TeardownConfig) String ¶
func (c *TeardownConfig) String() string
Click to show internal directories.
Click to hide internal directories.