Documentation ¶
Index ¶
- Constants
- Variables
- func DisableFeature(features *Feat, feature Feat)
- func EnableFeature(features *Feat, feature Feat)
- func IgnoredByTerway(labels map[string]string) bool
- func IsFeatureEnabled(features Feat, feature Feat) bool
- func NewRESTMapper() meta.RESTMapper
- func PodUseENI(pod *corev1.Pod) bool
- type ENIConfig
- type EniSelectionPolicy
- type ErrCode
- type Error
- type Feat
- type IPAMType
- type IPInsufficientError
- type IPNetSet
- type IPSet
- type IPSet2
- type IPStack
- type NetworkPrio
- type PodIPTypeIPs
- type PoolConfig
Constants ¶
View Source
const ( TagKeyClusterID = "ack.aliyun.com" // NetworkInterfaceTagCreatorKey denotes the creator tag's key of network interface NetworkInterfaceTagCreatorKey = "creator" // NetworkInterfaceTagCreatorValue denotes the creator tag's value of network interface NetworkInterfaceTagCreatorValue = "terway" // TagTerwayController terway controller TagTerwayController = "terway-controller" TagENIAllocPolicy = "eni-alloc-policy" TagK8SNodeName = "node-name" TagKubernetesPodName = "k8s_pod_name" TagKubernetesPodNamespace = "k8s_pod_namespace" )
this keys is used in alibabacloud resource
View Source
const ( // TrunkOn is the key for eni TrunkOn = AnnotationPrefix + "trunk-on" // PodENI whether pod is using podENI cr resource PodENI = AnnotationPrefix + "pod-eni" PodNetworking = AnnotationPrefix + "pod-networking" // PodIPReservation whether pod's IP will be reserved for a reuse PodIPReservation = AnnotationPrefix + "pod-ip-reservation" // PodNetworks for additional net config PodNetworks = AnnotationPrefix + "pod-networks" // PodAllocType for additional net config PodAllocType = AnnotationPrefix + "pod-alloc-type" // PodENIAllocated pod annotation for allocated eni PodENIAllocated = AnnotationPrefix + "allocated" // PodUID store pod uid PodUID = AnnotationPrefix + "pod-uid" // NetworkPriority set pod network priority NetworkPriority = AnnotationPrefix + "network-priority" ENIAllocFromPool = AnnotationPrefix + "eni-alloc-from-pool" ENIRelatedNodeName = AnnotationPrefix + "node" PodIPs = AnnotationPrefix + "pod-ips" // IgnoreByTerway if the label exist , terway will not handle this kind of res IgnoreByTerway = LabelPrefix + "ignore-by-terway" )
annotations used by terway
View Source
const ( EventCreateENISucceed = "CreateENISucceed" EventCreateENIFailed = "CreateENIFailed" EventAttachENISucceed = "AttachENISucceed" EventAttachENIFailed = "AttachENIFailed" EventDetachENISucceed = "DetachENISucceed" EventDetachENIFailed = "DetachENIFailed" EventDeleteENISucceed = "DeleteENISucceed" EventDeleteENIFailed = "DeleteENIFailed" EventUpdatePodENIFailed = "UpdatePodENIFailed" EventSyncPodNetworkingSucceed = "SyncPodNetworkingSucceed" EventSyncPodNetworkingFailed = "SyncPodNetworkingFailed" )
events for control plane
View Source
const ( SufficientIPCondition corev1.NodeConditionType = "SufficientIP" IPResInsufficientReason string = "InsufficientIP" IPResSufficientReason string = "SufficientIP" )
SufficientIPCondition definitions
View Source
const ( IPAMTypeCRD = "crd" IPAMTypePreferCRD = "preferCRD" IPAMTypeDefault = "" )
how terway deal with ip resource
View Source
const AnnotationPrefix = "k8s.aliyun.com/"
AnnotationPrefix is the annotation prefix
View Source
const FinalizerPodENI = "pod-eni"
FinalizerPodENI finalizer for podENI resource
View Source
const LabelPrefix = "k8s.aliyun.com/"
Variables ¶
View Source
var Scheme = runtime.NewScheme()
Functions ¶
func DisableFeature ¶ added in v1.8.0
func EnableFeature ¶ added in v1.8.0
func IgnoredByTerway ¶ added in v1.5.5
IgnoredByTerway for both pods and nodes
func IsFeatureEnabled ¶ added in v1.8.0
func NewRESTMapper ¶ added in v1.6.0
func NewRESTMapper() meta.RESTMapper
Types ¶
type EniSelectionPolicy ¶ added in v1.9.6
type EniSelectionPolicy string
const ( EniSelectionPolicyLeastIPs EniSelectionPolicy = "least_ips" EniSelectionPolicyMostIPs EniSelectionPolicy = "most_ips" )
Network interface Selection Policy
type ErrCode ¶ added in v1.7.0
type ErrCode string
const ( ErrInternalError ErrCode = "InternalError" ErrInvalidArgsErrCode ErrCode = "InvalidArgs" ErrInvalidDataType ErrCode = "InvalidDataType" ErrPodIsProcessing ErrCode = "PodIsProcessing" ErrResourceInvalid ErrCode = "ResourceInvalid" ErrOpenAPIErr ErrCode = "OpenAPIErr" ErrPodENINotReady ErrCode = "PodENINotReady" ErrIPOutOfSyncErr ErrCode = "OutIPOfSync" )
type IPInsufficientError ¶ added in v1.5.7
func (*IPInsufficientError) Error ¶ added in v1.5.7
func (e *IPInsufficientError) Error() string
type NetworkPrio ¶ added in v1.3.0
type NetworkPrio string
NetworkPrio network priority for pod
const ( NetworkPrioBestEffort NetworkPrio = "best-effort" NetworkPrioBurstable NetworkPrio = "burstable" NetworkPrioGuaranteed NetworkPrio = "guaranteed" )
NetworkPrio val
type PodIPTypeIPs ¶ added in v1.5.7
type PodIPTypeIPs string
PodIPTypeIPs Pod IP address type
const ( NormalIPTypeIPs PodIPTypeIPs = AnnotationPrefix + "max-available-ip" MemberENIIPTypeIPs PodIPTypeIPs = AnnotationPrefix + "max-member-eni-ip" ERDMAIPTypeIPs PodIPTypeIPs = AnnotationPrefix + "max-erdma-ip" )
PodIPTypeIPs val
type PoolConfig ¶
type PoolConfig struct { EnableIPv4 bool EnableIPv6 bool Capacity int // the max res can hold in the pool MaxENI int // the max eni terway can be created (already exclude main eni) MaxMemberENI int // the max member eni can be created ERdmaCapacity int // the max erdma res can be created MaxIPPerENI int BatchSize int MaxPoolSize int MinPoolSize int }
PoolConfig configuration of pool and resource factory
Source Files ¶
Click to show internal directories.
Click to hide internal directories.