types

package
v1.17.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 6 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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"

	PodNetworksRequest = AnnotationPrefix + "pod-networks-request"

	// 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"

	ENOApi = AnnotationPrefix + "eno-api"
)

annotations used by terway

View Source
const (
	APIEcs      = "ecs"
	APIEcsHDeni = "ecs-hdeni"
	APIEnoHDeni = "hdeni"
)
View Source
const (
	// IgnoreByTerway if the label exist , terway will not handle this kind of res
	IgnoreByTerway = LabelPrefix + "ignore-by-terway"

	ExclusiveENIModeLabel = LabelPrefix + "exclusive-mode-eni-type"

	LingJunNodeLabelKey = "alibabacloud.com/lingjun-worker"
)
View Source
const (
	// deprecated
	FinalizerPodENI   = "pod-eni"
	FinalizerPodENIV2 = "network.alibabacloud.com/pod-eni"
	FinalizerENI      = "network.alibabacloud.com/eni"
)

FinalizerPodENI finalizer for podENI resource

View Source
const (
	EventCreateENISucceed = "CreateENISucceed"

	EventCreateENIFailed  = "CreateENIFailed"
	EventAttachENISucceed = "AttachENISucceed"
	EventAttachENIFailed  = "AttachENIFailed"
	EventDetachENISucceed = "DetachENISucceed"
	EventDetachENIFailed  = "DetachENIFailed"
	EventDeleteENISucceed = "DeleteENISucceed"
	EventDeleteENIFailed  = "DeleteENIFailed"

	EventUpdatePodENIFailed = "UpdatePodENIFailed"
	EventDeletePodENIFailed = "DeletePodENIFailed"

	EventPodCreateFailed = "PodCreateFailed"
	EventPodDeleteFailed = "PodDeleteFailed"

	EventSyncPodNetworkingSucceed = "SyncPodNetworkingSucceed"
	EventSyncPodNetworkingFailed  = "SyncPodNetworkingFailed"

	EventConfigError = "ConfigError"
)

events for control plane

View Source
const (
	ActionCreateENI         = "CreateENI"
	ActionAttachENI         = "AttachENI"
	ActionDetachENI         = "DetachENI"
	ActionDeleteENI         = "DeleteENI"
	ActionUpdatePodENI      = "UpdatePodENI"
	ActionSyncPodNetworking = "SyncPodNetworking"
	ActionConfig            = "Config"
	ActionAllocIP           = "AllocIP"
	ActionSyncOpenAPI       = "SyncOpenAPI"
	ActionCreatePod         = "CreatePod"
	ActionDeletePod         = "DeletePod"
)

event actions used by events.EventRecorder

View Source
const (
	SufficientIPCondition   corev1.NodeConditionType = "SufficientIP"
	IPResInsufficientReason string                   = "InsufficientIP"
	IPResSufficientReason   string                   = "SufficientIP"
)

SufficientIPCondition definitions

View Source
const (
	ExclusiveDefault = ExclusiveENI("default")
	ExclusiveENIOnly = ExclusiveENI("eniOnly")
)
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 LabelPrefix = "k8s.aliyun.com/"

Variables

View Source
var Scheme = runtime.NewScheme()

Functions

func IgnoredByTerway added in v1.5.5

func IgnoredByTerway(labels map[string]string) bool

IgnoredByTerway for both pods and nodes

func NewRESTMapper added in v1.6.0

func NewRESTMapper() meta.RESTMapper

func PodUseENI added in v1.1.0

func PodUseENI(pod *corev1.Pod) bool

PodUseENI whether pod is use podENI cr res

Types

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"
	ErrIPNotAllocated ErrCode = "IPNotAllocated"

	ErrIPOutOfSyncErr ErrCode = "OutIPOfSync"
)

type Error added in v1.7.0

type Error struct {
	Code ErrCode
	Msg  string

	R error
}

func (*Error) Error added in v1.7.0

func (e *Error) Error() string

func (*Error) Unwrap added in v1.7.0

func (e *Error) Unwrap() error

type ExclusiveENI added in v1.11.1

type ExclusiveENI string

func NodeExclusiveENIMode added in v1.11.1

func NodeExclusiveENIMode(labels map[string]string) ExclusiveENI

type IPAMType added in v1.2.0

type IPAMType string

IPAMType how terway deal with ip resource

type IPInsufficientError added in v1.5.7

type IPInsufficientError struct {
	Err    error
	Reason string
}

func (*IPInsufficientError) Error added in v1.5.7

func (e *IPInsufficientError) Error() string

type IPNetSet added in v1.1.0

type IPNetSet struct {
	IPv4 *net.IPNet
	IPv6 *net.IPNet
}

func BuildIPNet added in v1.1.0

func BuildIPNet(ip, subnet *rpc.IPSet) (*IPNetSet, error)

func ToIPNetSet added in v1.1.0

func ToIPNetSet(ip *rpc.IPSet) (*IPNetSet, error)

func (*IPNetSet) SetIPNet added in v1.1.0

func (i *IPNetSet) SetIPNet(str string) *IPNetSet

func (*IPNetSet) String added in v1.1.0

func (i *IPNetSet) String() string

func (*IPNetSet) ToRPC added in v1.1.0

func (i *IPNetSet) ToRPC() *rpc.IPSet

type IPSet added in v1.1.0

type IPSet struct {
	IPv4 net.IP
	IPv6 net.IP
}

IPSet is the type hole both ipv4 and ipv6 net.IP

func ToIPSet added in v1.1.0

func ToIPSet(ip *rpc.IPSet) (*IPSet, error)

func (*IPSet) GetIPv4 added in v1.1.0

func (i *IPSet) GetIPv4() string

func (*IPSet) GetIPv6 added in v1.1.0

func (i *IPSet) GetIPv6() string

func (*IPSet) SetIP added in v1.1.0

func (i *IPSet) SetIP(str string) *IPSet

func (*IPSet) String added in v1.1.0

func (i *IPSet) String() string

func (*IPSet) ToRPC added in v1.1.0

func (i *IPSet) ToRPC() *rpc.IPSet

type IPSet2 added in v1.7.0

type IPSet2 struct {
	IPv4 netip.Addr
	IPv6 netip.Addr
}

func (*IPSet2) GetIPv4 added in v1.7.0

func (i *IPSet2) GetIPv4() string

func (*IPSet2) GetIPv6 added in v1.7.0

func (i *IPSet2) GetIPv6() string

func (*IPSet2) String added in v1.7.0

func (i *IPSet2) String() string

func (*IPSet2) ToRPC added in v1.7.0

func (i *IPSet2) ToRPC() *rpc.IPSet

type IPStack added in v1.1.0

type IPStack string

IPStack is the ip family type

const (
	IPStackIPv4 IPStack = "ipv4"
	IPStackDual IPStack = "dual"
	IPStackIPv6 IPStack = "ipv6"
)

IPStack is the ip family type

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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