Documentation
¶
Index ¶
- Constants
- func GetNetResourceAllocatedFromPods(pods []*Pod) map[string]map[string]NetResourceAllocated
- func PodKey(podNameSpace, podName string) string
- type ENI
- type ENIIP
- type IPFamily
- type IPNetSet
- type IPSet
- type MockNetResource
- type NetResource
- type NetResourceAllocated
- type NetResourceSnapshot
- type NetResourceStatus
- type Pod
- type PodNetwork
- type ResStatus
- type Route
- type Subnet
- type TrunkInfo
- type VPCResource
- type VPCResourceAllocated
Constants ¶
View Source
const ( AnnotationK8sPrefix = "k8s.volcengine.com/" AnnotationTrunkENI = AnnotationK8sPrefix + "trunk-eni" AnnotationPodNetworksDefinition = AnnotationK8sPrefix + "pod-networks-definition" AnnotationVKEPodNetworks = AnnotationK8sPrefix + "pod-networks" )
View Source
const ( PodNetworkModeENIExclusive = "eni_exclusive" )
View Source
const ( NetResourceTypeEni = "eni" NetResourceTypeEniIp = "eniIp" )
NetResourceType
View Source
const ( IPFamilyIPv4 = "ipv4" IPFamilyIPv6 = "ipv6" IPFamilyDual = "dual" )
View Source
const ( AnnotationVolcEnginePrefix = "vke.volcengine.com/" LabelNodeDynamicConfigKey = AnnotationVolcEnginePrefix + "vpc-cni-config" EvictionPolicyAnnotation = AnnotationVolcEnginePrefix + "cello-pod-evict-policy" AnnotationTrue = "true" AllowEviction = "allow" )
View Source
const (
// DefaultIfName is the default network interface for the pods
DefaultIfName = "eth0"
)
Variables ¶
This section is empty.
Functions ¶
func GetNetResourceAllocatedFromPods ¶
func GetNetResourceAllocatedFromPods(pods []*Pod) map[string]map[string]NetResourceAllocated
Types ¶
type ENI ¶
type ENI struct {
ID string
Mac net.HardwareAddr
PrimaryIP IPSet
Subnet Subnet
SecurityGroupIDs []string
Trunk bool // is trunk eni ?
}
ENI with all necessary information about ENI
func (*ENI) GetVPCResource ¶
func (e *ENI) GetVPCResource() VPCResource
type ENIIP ¶
func (*ENIIP) GetVPCResource ¶
func (e *ENIIP) GetVPCResource() VPCResource
type MockNetResource ¶
type MockNetResource struct {
ID string
}
func (*MockNetResource) GetID ¶
func (m *MockNetResource) GetID() string
func (*MockNetResource) GetType ¶
func (m *MockNetResource) GetType() string
func (*MockNetResource) GetVPCResource ¶
func (m *MockNetResource) GetVPCResource() VPCResource
type NetResource ¶
type NetResource interface {
GetID() string
GetType() string
GetVPCResource() VPCResource
}
type NetResourceAllocated ¶
type NetResourceAllocated struct {
Owner string
Resource NetResource
}
type NetResourceSnapshot ¶
type NetResourceSnapshot struct {
VPCResource
Status ResStatus `json:"status"`
Owner string `json:"owner,omitempty"`
}
func (*NetResourceSnapshot) GetID ¶
func (m *NetResourceSnapshot) GetID() string
func (*NetResourceSnapshot) GetOwner ¶
func (m *NetResourceSnapshot) GetOwner() string
func (*NetResourceSnapshot) GetStatus ¶
func (m *NetResourceSnapshot) GetStatus() ResStatus
func (*NetResourceSnapshot) GetType ¶
func (m *NetResourceSnapshot) GetType() string
func (*NetResourceSnapshot) GetVPCResource ¶
func (m *NetResourceSnapshot) GetVPCResource() VPCResource
type NetResourceStatus ¶
type NetResourceStatus interface {
NetResource
GetStatus() ResStatus
GetOwner() string
}
type Pod ¶
type Pod struct {
Namespace string `json:"nameSpace"`
Name string `json:"name"`
SandboxContainerId string `json:"sandboxContainerId"`
CreateTime time.Time `json:"createTime,omitempty"`
NetNs string `json:"netNs,omitempty"`
AllowEviction bool `json:"allowEviction,omitempty"`
VpcENI bool `json:"vpcENI,omitempty"`
MainInterface *pbrpc.NetworkInterface `json:"mainInterface,omitempty"` // Deprecated
ExtraInterfaces []*pbrpc.NetworkInterface `json:"extraInterfaces,omitempty"` // Deprecated
PodNetworkMode string `json:"podNetworkMode,omitempty"`
Resources []VPCResource `json:"resources,omitempty"`
}
func (*Pod) GetVPCResourceByType ¶
func (p *Pod) GetVPCResourceByType(rType string) []VPCResource
type PodNetwork ¶
type PodNetwork struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
IfName string `json:"ifName,omitempty"`
PodIP pbrpc.IPSet `json:"podIP"`
ExtraIPs []IPSet `json:"extraIPs,omitempty"`
Mac string `json:"mac,omitempty"`
Gateway pbrpc.IPSet `json:"gateway,omitempty"`
Cidr *pbrpc.IPSet `json:"cidr,omitempty"`
Route *Route `json:"route,omitempty"`
ENIId string `json:"eniId,omitempty"`
TrunkENIId string `json:"trunkENIId,omitempty"`
VlanID uint32 `json:"vlanID,omitempty"`
}
type Route ¶
type Route struct {
// Dst means the destination address
Dst string `json:"dst,omitempty"`
}
type Subnet ¶
type Subnet struct {
ID string
Gateway *IPSet
GatewayMac net.HardwareAddr
CIDR *IPNetSet
}
type VPCResource ¶
type VPCResource struct {
Type string `json:"type"`
ID string `json:"id"`
ENIId string `json:"ENIId"`
ENIMac string `json:"ENIMac"`
IPv4 string `json:"ipv4,omitempty"`
IPv6 string `json:"ipv6,omitempty"`
}
VPCResource is network resource of vpc
func (*VPCResource) ToNetResource ¶
func (r *VPCResource) ToNetResource() (res NetResource)
type VPCResourceAllocated ¶
type VPCResourceAllocated struct {
Owner string
Resource VPCResource
}
Click to show internal directories.
Click to hide internal directories.