diff --git a/cloudprovider/alibabacloud/eip.go b/cloudprovider/alibabacloud/eip.go index 884dab5c..695987f0 100644 --- a/cloudprovider/alibabacloud/eip.go +++ b/cloudprovider/alibabacloud/eip.go @@ -21,6 +21,7 @@ const ( BandwidthConfigName = "Bandwidth" BandwidthPackageIdConfigName = "BandwidthPackageId" ChargeTypeConfigName = "ChargeType" + DescriptionConfigName = "Description" WithEIPAnnotationKey = "k8s.aliyun.com/pod-with-eip" ReleaseStrategyAnnotationkey = "k8s.aliyun.com/pod-eip-release-strategy" PoolIdAnnotationkey = "k8s.aliyun.com/eip-public-ip-address-pool-id" @@ -28,6 +29,8 @@ const ( BandwidthAnnotationkey = "k8s.aliyun.com/eip-bandwidth" BandwidthPackageIdAnnotationkey = "k8s.aliyun.com/eip-common-bandwidth-package-id" ChargeTypeConfigAnnotationkey = "k8s.aliyun.com/eip-internet-charge-type" + EIPNameAnnotationKey = "k8s.aliyun.com/eip-name" + EIPDescriptionAnnotationKey = "k8s.aliyun.com/eip-description" ) type EipPlugin struct { @@ -50,6 +53,7 @@ func (E EipPlugin) OnPodAdded(client client.Client, pod *corev1.Pod, ctx context conf := networkManager.GetNetworkConfig() pod.Annotations[WithEIPAnnotationKey] = "true" + pod.Annotations[EIPNameAnnotationKey] = pod.GetNamespace() + "/" + pod.GetName() // parse network configuration for _, c := range conf { switch c.Name { @@ -65,6 +69,8 @@ func (E EipPlugin) OnPodAdded(client client.Client, pod *corev1.Pod, ctx context pod.Annotations[BandwidthPackageIdAnnotationkey] = c.Value case ChargeTypeConfigName: pod.Annotations[ChargeTypeConfigAnnotationkey] = c.Value + case DescriptionConfigName: + pod.Annotations[EIPDescriptionAnnotationKey] = c.Value } } diff --git a/docs/en/user_manuals/network.md b/docs/en/user_manuals/network.md index 5088f251..3dd0b89d 100644 --- a/docs/en/user_manuals/network.md +++ b/docs/en/user_manuals/network.md @@ -531,6 +531,11 @@ ChargeType - PayByBandwidth: Fees are charged based on bandwidth usage. - Configuration change supported or not: no. +Description + +- Meaning: The description of EIP resource +- Configuration change supported or not: no. + #### Plugin configuration None @@ -609,4 +614,6 @@ status: privateIPAddress: 192.168.1.51 resourceGroupID: rg-xxx status: InUse -``` \ No newline at end of file +``` + +In addition, the generated EIP resource will be named after {pod namespace}/{pod name} in the Alibaba Cloud console, which corresponds to each game server one by one. \ No newline at end of file diff --git "a/docs/\344\270\255\346\226\207/\347\224\250\346\210\267\346\211\213\345\206\214/\347\275\221\347\273\234\346\250\241\345\236\213.md" "b/docs/\344\270\255\346\226\207/\347\224\250\346\210\267\346\211\213\345\206\214/\347\275\221\347\273\234\346\250\241\345\236\213.md" index c50e35ec..0007a067 100644 --- "a/docs/\344\270\255\346\226\207/\347\224\250\346\210\267\346\211\213\345\206\214/\347\275\221\347\273\234\346\250\241\345\236\213.md" +++ "b/docs/\344\270\255\346\226\207/\347\224\250\346\210\267\346\211\213\345\206\214/\347\275\221\347\273\234\346\250\241\345\236\213.md" @@ -529,6 +529,11 @@ ChargeType - PayByBandwidth:按带宽计费,为默认值。 - 是否支持变更:否 +Description + +- 含义:对EIP资源的描述。 +- 是否支持变更:否 + #### 插件配置 无 @@ -609,6 +614,8 @@ status: status: InUse ``` +此外,生成的EIP资源在阿里云控制台中会以{pod namespace}/{pod name}命名,与每一个游戏服一一对应。 + ## 获取网络信息 GameServer Network Status可以通过两种方式获取