Skip to content

Commit 7e8a0f7

Browse files
committed
update at 2024-07-12 16:43:41
1 parent 9b14a7e commit 7e8a0f7

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
11
# tke-extend-network-controller
2-
A Network Controller for TKE
2+
3+
`tke-extend-network-controller` 是针对 TKE 集群一些特殊场景的的网络控制器。
4+
5+
## 游戏场景
6+
7+
大多游戏都有战斗服,每个 Pod 都需要一个独立的公网地址 (IP:Port),而 TKE 集群默认不提供这个能力,可通过安装此插件来实现为每个 Pod 都分配一个独立的公网地址。
8+
9+
## 使用 NAT 网关分配地址
10+
11+
通过自动为 NAT 网关添加 DNAT 规则(端口转发) 来实现为 Pod 分配独立的公网地址:
12+
13+
```yaml
14+
apiVersion: networking.cloud.tencent.com/v1apha1
15+
kind: UniqNatGwEndpoint
16+
metadata:
17+
namespace: demo
18+
name: gameserver
19+
spec:
20+
minPort: 500 # 在NAT网关自动创建端口转发,每个 Pod 占用 NAT 网关的一个 IP:Port,端口号范围在 500-600
21+
maxPort: 600
22+
service: gameserver
23+
extensiveParameters: '{"InternetMaxBandwidthOut":5000, "NatProductVersion":2}' # 如果自动创建NAT,指定购买NAT接口的参数: https://cloud.tencent.com/document/api/215/36721
24+
existNatgwIds: # 如果复用已有的 NAT 网关实例,指定 NAT 网关实例 ID 的列表
25+
- nat-xxx
26+
- nat-yyy
27+
- nat-zzz
28+
```
29+
30+
## 使用 CLB 分配地址
31+
32+
通过自动为 CLB 创建监听器并绑定单个 Pod 来实现为 Pod 分配独立的公网地址:
33+
34+
```yaml
35+
apiVersion: networking.cloud.tencent.com/v1apha1
36+
kind: UniqCLBEndpoint
37+
metadata:
38+
namespace: demo
39+
name: gameserver
40+
spec:
41+
minPort: 500 # 在CLB自动创建监听器,每个Pod占用一个端口,端口号范围在 500-600
42+
maxPort: 600
43+
service: gameserver
44+
extensiveParameters: '{"VipIsp":"CTCC"}' # 如果自动创建CLB,指定购买CLB接口的参数: https://cloud.tencent.com/document/product/214/30692
45+
existLbIds: # 如果复用已有的 CLB 实例,指定 CLB 实例 ID 的列表
46+
- lb-xxx
47+
- lb-yyy
48+
- lb-zzz
49+
```

0 commit comments

Comments
 (0)