Documentation ¶
Index ¶
- Constants
- Variables
- func IsPodEnableStaticIP(client *kubernetes.Clientset, podName, podNS string) (bool, *v1.Pod, error)
- func PodNetworkToVip(pNet *rpc.PodNetwork) *v1beta1.VpcIpClaim
- func Start() error
- func VipToPodNetwork(vip *v1beta1.VpcIpClaim) *rpc.PodNetwork
- type CooldownItem
- type EIPCfg
- type InnerAddPodNetworkRequest
- type InnerAddPodNetworkResponse
- type InnerDelPodNetworkRequest
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" //解决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 PodNetworkToVip ¶
func PodNetworkToVip(pNet *rpc.PodNetwork) *v1beta1.VpcIpClaim
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 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 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.