diff --git a/i18n/zh/docusaurus-plugin-content-docs-kruisegame/current/user-manuals/network.md b/i18n/zh/docusaurus-plugin-content-docs-kruisegame/current/user-manuals/network.md index d6547af61..bd597978a 100644 --- a/i18n/zh/docusaurus-plugin-content-docs-kruisegame/current/user-manuals/network.md +++ b/i18n/zh/docusaurus-plugin-content-docs-kruisegame/current/user-manuals/network.md @@ -20,6 +20,7 @@ OKG 会集成不同云提供商的不同网络插件,用户可通过GameServer - AlibabaCloud-NLB-SharedPort - Volcengine-CLB - AmazonWebServices-NLB +- TencentCloud-CLB --- ### Kubernetes-HostPort @@ -1408,6 +1409,109 @@ networkStatus: networkType: AmazonWebServices-NLB ``` +--- + +### TencentCloud-CLB + +#### 插件名称 + +`TencentCloud-CLB` + +#### Cloud Provider + +TencentCloud + +#### 插件说明 + +- TencentCloud-CLB 使用腾讯云负载均衡器(CLB)作为对外服务的承载实体,在此模式下,不同游戏服使用 CLB 的不同端口对外暴露,此时 CLB 只做转发,并未均衡流量。 +- 需安装 [tke-extend-network-controller](https://github.com/tkestack/tke-extend-network-controller) 网络插件(可通过 TKE 应用市场安装)。 +- 是否支持网络隔离:否。 + +#### 网络参数 + +ClbIds + +- 含义:填写clb的id。可填写多个。 +- 填写格式:各个clbId用,分割。例如:lb-xxxx,lb-yyyy,... +- 是否支持变更:支持。 + +PortProtocols + +- 含义:pod暴露的端口及协议,支持填写多个端口/协议。 +- 格式:port1/protocol1,port2/protocol2,...(协议需大写) +- 是否支持变更:支持。 + +#### 插件配置 + +```toml +[tencentcloud] +enable = true +[tencentcloud.clb] +# 填写clb可使用的空闲端口段,用于为pod分配外部接入端口 +min_port = 1000 +max_port = 1100 +``` + +#### 示例说明 + +```yaml +apiVersion: game.kruise.io/v1alpha1 +kind: GameServerSet +metadata: + name: clb-nginx + namespace: default +spec: + replicas: 1 + updateStrategy: + rollingUpdate: + podUpdatePolicy: InPlaceIfPossible + network: + networkType: TencentCloud-CLB + networkConf: + - name: ClbIds + value: "lb-3ip9k5kr,lb-4ia8k0yh" + - name: PortProtocols + value: "80/TCP,7777/UDP" + gameServerTemplate: + spec: + containers: + - image: nginx + name: nginx +``` + +生成的 gameserver clb-nginx-0 networkStatus 字段如下所示: + +```yaml + networkStatus: + createTime: "2024-10-28T03:16:20Z" + currentNetworkState: Ready + desiredNetworkState: Ready + externalAddresses: + - ip: 139.155.64.52 + ports: + - name: "80" + port: 1002 + protocol: TCP + - ip: 139.155.64.52 + ports: + - name: "7777" + port: 1003 + protocol: UDP + internalAddresses: + - ip: 172.16.7.106 + ports: + - name: "80" + port: 80 + protocol: TCP + - ip: 172.16.7.106 + ports: + - name: "7777" + port: 7777 + protocol: UDP + lastTransitionTime: "2024-10-28T03:16:20Z" + networkType: TencentCloud-CLB +``` + ## 网络隔离 考虑以下场景,如: @@ -1538,4 +1642,4 @@ echo " IP: $ip, Port: $port" Q: 如何更改网络插件配置? -A: 可以通过编辑kruise-game-system命名空间下的configmap对默认参数进行更改。更改后重建kruise-game-manager,使配置生效。建议集群游戏服已使用OKG网络插件的情况下不轻易更改相应配置,应提前做好合理的网络规划。 \ No newline at end of file +A: 可以通过编辑kruise-game-system命名空间下的configmap对默认参数进行更改。更改后重建kruise-game-manager,使配置生效。建议集群游戏服已使用OKG网络插件的情况下不轻易更改相应配置,应提前做好合理的网络规划。 diff --git a/kruisegame/user-manuals/network.md b/kruisegame/user-manuals/network.md index 984391e41..abecbb2d3 100644 --- a/kruisegame/user-manuals/network.md +++ b/kruisegame/user-manuals/network.md @@ -20,6 +20,7 @@ OpenKruiseGame supports the following network plugins: - AlibabaCloud-NLB-SharedPort - Volcengine-CLB - AmazonWebServices-NLB +- TencentCloud-CLB --- ### Kubernetes-HostPort @@ -1377,6 +1378,109 @@ spec: EOF ``` +--- + +### TencentCloud-CLB + +#### Plugin name + +`TencentCloud-CLB` + +#### Cloud Provider + +TencentCloud + +#### Plugin description + +- TencentCloud-CLB enables game servers to be accessed from the Internet by using Cloud Load Balancer (CLB) of Tencent Cloud. CLB is a type of Server Load Balancer (CLB). TencentCloud-CLB uses different ports for different game servers. The CLB instance only forwards traffic, but does not implement load balancing. +- The [tke-extend-network-controller](https://github.com/tkestack/tke-extend-network-controller) network plugin needs to be installed (can be installed through the TKE application market). +- This network plugin does not support network isolation. + +#### Network parameters + +ClbIds + +- Meaning: the CLB instance ID. You can fill in multiple ids. +- Value: in the format of slbId-0,slbId-1,... An example value can be "lb-9zeo7prq1m25ctpfrw1m7,lb-bp1qz7h50yd3w58h2f8je" +- Configuration change supported or not: yes. You can add new slbIds at the end. However, it is recommended not to change existing slbId that is in use. + +PortProtocols + +- Meaning: the ports in the pod to be exposed and the protocols. You can specify multiple ports and protocols. +- Value: in the format of port1/protocol1,port2/protocol2,... The protocol names must be in uppercase letters. +- Configuration change supported or not: yes. + +#### Plugin configuration + +```toml +[tencentcloud] +enable = true +[tencentcloud.clb] +# Specify the range of available ports of the CLB instance. Ports in this range can be used to forward Internet traffic to pods. In this example, the range includes 200 ports. +min_port = 1000 +max_port = 1100 +``` + +#### Example + +```yaml +apiVersion: game.kruise.io/v1alpha1 +kind: GameServerSet +metadata: + name: clb-nginx + namespace: default +spec: + replicas: 1 + updateStrategy: + rollingUpdate: + podUpdatePolicy: InPlaceIfPossible + network: + networkType: TencentCloud-CLB + networkConf: + - name: ClbIds + value: "lb-3ip9k5kr,lb-4ia8k0yh" + - name: PortProtocols + value: "80/TCP,7777/UDP" + gameServerTemplate: + spec: + containers: + - image: nginx + name: nginx +``` + +The network status of GameServer would be as follows: + +```yaml + networkStatus: + createTime: "2024-10-28T03:16:20Z" + currentNetworkState: Ready + desiredNetworkState: Ready + externalAddresses: + - ip: 139.155.64.52 + ports: + - name: "80" + port: 1002 + protocol: TCP + - ip: 139.155.64.52 + ports: + - name: "7777" + port: 1003 + protocol: UDP + internalAddresses: + - ip: 172.16.7.106 + ports: + - name: "80" + port: 80 + protocol: TCP + - ip: 172.16.7.106 + ports: + - name: "7777" + port: 7777 + protocol: UDP + lastTransitionTime: "2024-10-28T03:16:20Z" + networkType: TencentCloud-CLB +``` + ## Network Isolation Consider the following scenarios, such as: @@ -1508,4 +1612,4 @@ echo " IP: $ip, Port: $port" Q: How to change the network plugin configuration? -A: The default parameters can be changed by editing the configmap under the kruise-game-system namespace. After the change, rebuild kruise-game-manager to make the configuration take effect. It is recommended that the cluster game service already uses the OKG network plug-in does not easily change the corresponding configuration, and should do a reasonable network planning in advance. \ No newline at end of file +A: The default parameters can be changed by editing the configmap under the kruise-game-system namespace. After the change, rebuild kruise-game-manager to make the configuration take effect. It is recommended that the cluster game service already uses the OKG network plug-in does not easily change the corresponding configuration, and should do a reasonable network planning in advance.