ipamd

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeNodeLabelUhostID    = "UhostID"
	KubeNodeZoneKey         = "failure-domain.beta.kubernetes.io/zone"
	KubeNodeZoneTopologyKey = "topology.kubernetes.io/zone"
	KubeNodeInstanceTypeKey = "node.uk8s.ucloud.cn/instance_type"
	KubeNodeMachineTypeKey  = "node.uk8s.ucloud.cn/machine_type"

	AnnotationPodNeedEIP       = "network.kubernetes.io/eip"
	AnnotationEIPID            = "network.kubernetes.io/eip-id"
	AnnotationEIPAddr          = "network.kubernetes.io/eip-addr"
	AnnotationUNIID            = "network.kubernetes.io/uni-id"
	AnnotationEIPPayMode       = "network.kubernetes.io/eip-paymode"
	AnnotationEIPBandwidth     = "network.kubernetes.io/eip-bandwidth"
	AnnotationEIPChargeType    = "network.kubernetes.io/eip-chargetype"
	AnnotationEIPQuantity      = "network.kubernetes.io/eip-quantity"
	AnnotationSecurityGroupId  = "network.kubernetes.io/security-group-id"
	AnnotationShareBandwidthId = "network.kubernetes.io/sharebandwidth-id"

	//解决calico policy 在使用了postStart情况下规则无法及时下发的问题 https://github.com/projectcalico/calico/issues/3499
	//annotaion 见calico项目 https://github.com/projectcalico/calico/blob/79b442a53adb7d7f1fd62927d9322daf87dce9de/libcalico-go/lib/backend/k8s/conversion/constants.go
	//用户想使用该特性,必须要在启动参数设置calicoPolicyFlag=true
	AnnotationCalicoPolicyPodIP = "cni.projectcalico.org/podIP"
)
View Source
const (
	IpamdServiceSocket   = "/run/cni-vpc-ipamd.sock"
	NetworkDBName        = "cni-vpc-network"
	PoolDBName           = "cni-vpc-ip-pool"
	CooldownDBName       = "cni-vpc-ip-cooldown"
	DefaultListenTCPPort = 7312
)
View Source
const (
	ResourceTypeUNI = "uni"

	UAPIErrorIPNotExst       = 58221
	UAPIErrorSubnetNotEnough = 57000
)
View Source
const (
	STS_ENABLE_STATIC_IP  = "network.beta.kubernetes.io/ucloud-statefulset-static-ip"
	STS_STATIC_IP_RELEASE = "network.beta.kubernetes.io/ucloud-statefulset-ip-claim-policy"
)

Variables

View Source
var (
	AvailablePodIPLowWatermark  int   = 3
	AvailablePodIPHighWatermark int   = 50
	CalicoPolicyFlag            bool  = false
	CooldownPeriodSeconds       int64 = 30
)
View Source
var ErrOutOfIP = errors.New("vpc out of ip")

Functions

func IsPodEnableStaticIP added in v1.2.3

func IsPodEnableStaticIP(client *kubernetes.Clientset, podName, podNS string) (bool, *v1.Pod, error)

func PodNetworkToVip

func PodNetworkToVip(pNet *rpc.PodNetwork) *v1beta1.VpcIpClaim

func Start added in v1.0.1

func Start() error

func VipToPodNetwork

func VipToPodNetwork(vip *v1beta1.VpcIpClaim) *rpc.PodNetwork

Types

type CooldownItem added in v1.2.0

type CooldownItem struct {
	Network *rpc.PodNetwork

	CooldownOver int64
}

type EIPCfg

type EIPCfg struct {
	Bandwidth        int
	Quantity         int
	EIPId            string
	PayMode          string
	ChargeType       string
	SecurityGroupId  string
	ShareBandwidthId string
}

type InnerAddPodNetworkRequest

type InnerAddPodNetworkRequest struct {
	Req      *rpc.AddPodNetworkRequest
	Receiver chan *InnerAddPodNetworkResponse
}

type InnerAddPodNetworkResponse

type InnerAddPodNetworkResponse struct {
	PodNetwork *rpc.PodNetwork
	Err        error
}

type InnerDelPodNetworkRequest

type InnerDelPodNetworkRequest struct {
	Req      *rpc.DelPodNetworkRequest
	Receiver chan error
}

Jump to

Keyboard shortcuts

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