docs:add OKG network plugin: JdCloud-NLB 、JdCloud-EIP (#218)
* docs:add OKG network plugin: JdCloud-NLB 、JdCloud-EIP Signed-off-by: hhr <691129301@qq.com> * docs:add OKG network plugin: JdCloud-NLB 、JdCloud-EIP Signed-off-by: hhr <691129301@qq.com> * fix yaml example Signed-off-by: hhr <691129301@qq.com> * fix md format Signed-off-by: hhr <691129301@qq.com> --------- Signed-off-by: hhr <691129301@qq.com>
This commit is contained in:
parent
d8417a85cf
commit
33858a2499
|
|
@ -21,6 +21,8 @@ OKG 会集成不同云提供商的不同网络插件,用户可通过GameServer
|
|||
- Volcengine-CLB
|
||||
- AmazonWebServices-NLB
|
||||
- TencentCloud-CLB
|
||||
- JdCloud-NLB
|
||||
- JdCloud-EIP
|
||||
|
||||
---
|
||||
### Kubernetes-HostPort
|
||||
|
|
@ -1512,6 +1514,204 @@ spec:
|
|||
networkType: TencentCloud-CLB
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JdCloud-NLB
|
||||
|
||||
#### 插件名称
|
||||
|
||||
`JdCloud-NLB`
|
||||
|
||||
#### Cloud Provider
|
||||
|
||||
JdCloud
|
||||
|
||||
#### 插件说明
|
||||
|
||||
京东云容器服务支持在k8s中对NLB复用的机制,不同的svc可以使用同一个NLB的不同端口。由此,JdCloud-NLB network plugin将记录各NLB对应的端口分配情况,对于指定了网络类型为JdCloud-NLB,JdCloud-NLB网络插件将会自动分配一个端口并创建一个service对象,待检测到svc公网IP创建成功后,GameServer的网络变为Ready状态,该过程执行完成。
|
||||
|
||||
#### 网络参数
|
||||
|
||||
NlbIds
|
||||
- 含义:填写nlb的id,可填写多个,需要先在【京东云】中创建好nlb。
|
||||
- 填写格式:各个nlbId用,分割。例如:netlb-aaa,netlb-bbb,...
|
||||
- 是否支持变更:是
|
||||
|
||||
PortProtocols
|
||||
- 含义:pod暴露的端口及协议,支持填写多个端口/协议
|
||||
- 填写格式:port1/protocol1,port2/protocol2,...(协议需大写)
|
||||
- 是否支持变更:是
|
||||
|
||||
Fixed
|
||||
- 含义:是否固定访问IP/端口。若是,即使pod删除重建,网络内外映射关系不会改变
|
||||
- 填写格式:false / true
|
||||
- 是否支持变更:是
|
||||
|
||||
#### 插件配置
|
||||
|
||||
```toml
|
||||
[jdcloud]
|
||||
enable = true
|
||||
[jdcloud.nlb]
|
||||
#填写nlb可使用的空闲端口段,用于为pod分配外部接入端口,范围最大为200
|
||||
max_port = 700
|
||||
min_port = 500
|
||||
```
|
||||
|
||||
#### 示例说明
|
||||
|
||||
```yaml
|
||||
apiVersion: game.kruise.io/v1alpha1
|
||||
kind: GameServerSet
|
||||
metadata:
|
||||
name: nlb
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 3
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
podUpdatePolicy: InPlaceIfPossible
|
||||
network:
|
||||
networkType: JdCloud-NLB
|
||||
networkConf:
|
||||
- name: NlbIds
|
||||
#Fill in Jdcloud Cloud LoadBalancer Id here
|
||||
value: netlb-xxxxx
|
||||
- name: PortProtocols
|
||||
#Fill in the exposed ports and their corresponding protocols here.
|
||||
#If there are multiple ports, the format is as follows: {port1}/{protocol1},{port2}/{protocol2}...
|
||||
#If the protocol is not filled in, the default is TCP
|
||||
value: 80/TCP
|
||||
- name: AllocateLoadBalancerNodePorts
|
||||
# Whether the generated service is assigned nodeport.
|
||||
value: "true"
|
||||
- name: Fixed
|
||||
#Fill in here whether a fixed IP is required [optional] ; Default is false
|
||||
value: "false"
|
||||
- name: Annotations
|
||||
#Fill in the anno related to clb on the service
|
||||
#The format is as follows: {key1}:{value1},{key2}:{value2}...
|
||||
value: "key1:value1,key2:value2"
|
||||
gameServerTemplate:
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- /data/server/start.sh
|
||||
command:
|
||||
- /bin/bash
|
||||
image: gss-cn-north-1.jcr.service.jdcloud.com/gsshosting/pal:v1
|
||||
name: game-server
|
||||
```
|
||||
生成的 gameserver nlb-0 networkStatus 字段如下所示:
|
||||
|
||||
```yaml
|
||||
networkStatus:
|
||||
createTime: "2024-11-04T08:00:20Z"
|
||||
currentNetworkState: Ready
|
||||
desiredNetworkState: Ready
|
||||
externalAddresses:
|
||||
- ip: xxx.xxx.xxx.xxx
|
||||
ports:
|
||||
- name: "8211"
|
||||
port: 531
|
||||
protocol: UDP
|
||||
internalAddresses:
|
||||
- ip: 10.0.0.95
|
||||
ports:
|
||||
- name: "8211"
|
||||
port: 8211
|
||||
protocol: UDP
|
||||
lastTransitionTime: "2024-11-04T08:00:20Z"
|
||||
networkType: JdCloud-NLB
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JdCloud-EIP
|
||||
|
||||
#### 插件名称
|
||||
|
||||
`JdCloud-EIP`
|
||||
|
||||
#### Cloud Provider
|
||||
|
||||
JdCloud
|
||||
|
||||
#### 插件说明
|
||||
|
||||
京东云容器服务支持在k8s中,让一个 pod 和弹性公网 IP 直接进行绑定,可以让 pod 直接与外部网络进行通信。
|
||||
- 集群的网络插件使用 yunjian-CNI,不可使用 flannel 创建集群
|
||||
- 弹性公网 IP 使用限制请具体参考京东云弹性公网 IP 产品文档
|
||||
- 安装 EIP-Controller 组件
|
||||
- 弹性公网 IP 不会随 POD 的销毁而删除
|
||||
|
||||
#### 网络参数
|
||||
|
||||
BandwidthConfigName
|
||||
- 含义:弹性公网IP的带宽,单位为 Mbps,取值范围为 [1,1024]
|
||||
- 填写格式:必须填整数,且不带单位
|
||||
- 是否支持变更:是
|
||||
|
||||
ChargeTypeConfigName
|
||||
- 含义:弹性公网IP的计费方式,取值:按量计费:postpaid_by_usage,包年包月:postpaid_by_duration
|
||||
- 填写格式:字符串
|
||||
- 是否支持变更:是
|
||||
|
||||
FixedEIPConfigName
|
||||
- 含义:是否固定弹性公网IP。若是,即使pod删除重建,弹性公网IP也不会改变
|
||||
- 填写格式:"false" / "true",字符串
|
||||
- 是否支持变更:是
|
||||
|
||||
AssignEIPConfigName
|
||||
- 含义:是否指定使用某个弹性公网IP,请填写 true,否则自动分配一个EIP
|
||||
- 填写格式:"false" / "true",字符串
|
||||
|
||||
EIPIdConfigName
|
||||
- 含义:若指定使用某个弹性公网IP,则必须填写弹性公网IP的ID,,组件会自动进行进行查询和绑定
|
||||
- 填写格式:字符串,例如:fip-xxxxxxxx
|
||||
|
||||
#### 示例说明
|
||||
|
||||
```yaml
|
||||
apiVersion: game.kruise.io/v1alpha1
|
||||
kind: GameServerSet
|
||||
metadata:
|
||||
name: eip
|
||||
namespace: default
|
||||
spec:
|
||||
gameServerTemplate:
|
||||
spec:
|
||||
containers:
|
||||
- image: gss-cn-north-1.jcr.service.jdcloud.com/gsshosting/pal:v1
|
||||
name: game-server
|
||||
network:
|
||||
networkType: JdCloud-EIP
|
||||
networkConf:
|
||||
- name: "BandWidth"
|
||||
value: "10"
|
||||
- name: "ChargeType"
|
||||
value: postpaid_by_usage
|
||||
- name: "Fixed"
|
||||
value: "false"
|
||||
replicas: 3
|
||||
```
|
||||
|
||||
生成的 gameserver eip-0 networkStatus 字段如下所示:
|
||||
|
||||
```yaml
|
||||
networkStatus:
|
||||
createTime: "2024-11-04T10:53:14Z"
|
||||
currentNetworkState: Ready
|
||||
desiredNetworkState: Ready
|
||||
externalAddresses:
|
||||
- ip: xxx.xxx.xxx.xxx
|
||||
internalAddresses:
|
||||
- ip: 10.0.0.95
|
||||
lastTransitionTime: "2024-11-04T10:53:14Z"
|
||||
networkType: JdCloud-EIP
|
||||
```
|
||||
|
||||
|
||||
## 网络隔离
|
||||
|
||||
考虑以下场景,如:
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ OpenKruiseGame supports the following network plugins:
|
|||
- Volcengine-CLB
|
||||
- AmazonWebServices-NLB
|
||||
- TencentCloud-CLB
|
||||
- JdCloud-NLB
|
||||
- JdCloud-EIP
|
||||
|
||||
---
|
||||
### Kubernetes-HostPort
|
||||
|
|
@ -1482,6 +1484,206 @@ The network status of GameServer would be as follows:
|
|||
networkType: TencentCloud-CLB
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JdCloud-NLB
|
||||
|
||||
#### Plugin name
|
||||
|
||||
`JdCloud-NLB`
|
||||
|
||||
#### Cloud Provider
|
||||
|
||||
JDCloud
|
||||
|
||||
#### Plugin description
|
||||
|
||||
JdCloud Container Service supports the reuse of NLB (Network Load Balancer) in Kubernetes. Different services (svcs) can use different ports of the same NLB. As a result, the JdCloud-NLB network plugin will record the port allocation for each NLB. For services that specify the network type as JdCloud-NLB, the JdCloud-NLB network plugin will automatically allocate a port and create a service object. Once it detects that the public IP of the svc has been successfully created, the GameServer's network will transition to the Ready state, completing the process.
|
||||
|
||||
#### Network parameters
|
||||
|
||||
NlbIds
|
||||
- Meaning:fill in the id of the clb. You can fill in more than one. You need to create the clb in [JdCloud].
|
||||
- Value:each clbId is divided by `,` . For example:`netlb-aaa,netlb-bbb,...`
|
||||
- Configurable:Y
|
||||
|
||||
PortProtocols
|
||||
- Meaning:the ports and protocols exposed by the pod, support filling in multiple ports/protocols
|
||||
- Value:`port1/protocol1`,`port2/protocol2`,... The protocol names must be in uppercase letters.
|
||||
- Configurable:Y
|
||||
|
||||
Fixed
|
||||
- Meaning:whether the mapping relationship is fixed. If the mapping relationship is fixed, the mapping relationship remains unchanged even if the pod is deleted and recreated.
|
||||
- Value:false / true
|
||||
- Configurable:Y
|
||||
|
||||
#### Plugin configuration
|
||||
|
||||
```toml
|
||||
[jdcloud]
|
||||
enable = true
|
||||
[jdcloud.nlb]
|
||||
#To allocate external access ports for Pods, you need to define the idle port ranges that the NLB (Network Load Balancer) can use. The maximum range for each port segment is 200 ports.
|
||||
max_port = 700
|
||||
min_port = 500
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
```yaml
|
||||
apiVersion: game.kruise.io/v1alpha1
|
||||
kind: GameServerSet
|
||||
metadata:
|
||||
name: nlb
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 3
|
||||
updateStrategy:
|
||||
rollingUpdate:
|
||||
podUpdatePolicy: InPlaceIfPossible
|
||||
network:
|
||||
networkType: JdCloud-NLB
|
||||
networkConf:
|
||||
- name: NlbIds
|
||||
#Fill in Jdcloud Cloud LoadBalancer Id here
|
||||
value: netlb-xxxxx
|
||||
- name: PortProtocols
|
||||
#Fill in the exposed ports and their corresponding protocols here.
|
||||
#If there are multiple ports, the format is as follows: {port1}/{protocol1},{port2}/{protocol2}...
|
||||
#If the protocol is not filled in, the default is TCP
|
||||
value: 80/TCP
|
||||
- name: AllocateLoadBalancerNodePorts
|
||||
# Whether the generated service is assigned nodeport.
|
||||
value: "true"
|
||||
- name: Fixed
|
||||
#Fill in here whether a fixed IP is required [optional] ; Default is false
|
||||
value: "false"
|
||||
- name: Annotations
|
||||
#Fill in the anno related to clb on the service
|
||||
#The format is as follows: {key1}:{value1},{key2}:{value2}...
|
||||
value: "key1:value1,key2:value2"
|
||||
gameServerTemplate:
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- /data/server/start.sh
|
||||
command:
|
||||
- /bin/bash
|
||||
image: gss-cn-north-1.jcr.service.jdcloud.com/gsshosting/pal:v1
|
||||
name: game-server
|
||||
```
|
||||
|
||||
The network status of GameServer would be as follows:
|
||||
|
||||
```yaml
|
||||
networkStatus:
|
||||
createTime: "2024-11-04T08:00:20Z"
|
||||
currentNetworkState: Ready
|
||||
desiredNetworkState: Ready
|
||||
externalAddresses:
|
||||
- ip: xxx.xxx.xxx.xxx
|
||||
ports:
|
||||
- name: "8211"
|
||||
port: 531
|
||||
protocol: UDP
|
||||
internalAddresses:
|
||||
- ip: 10.0.0.95
|
||||
ports:
|
||||
- name: "8211"
|
||||
port: 8211
|
||||
protocol: UDP
|
||||
lastTransitionTime: "2024-11-04T08:00:20Z"
|
||||
networkType: JdCloud-NLB
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### JdCloud-EIP
|
||||
|
||||
#### Plugin name
|
||||
|
||||
`JdCloud-EIP`
|
||||
|
||||
#### Cloud Provider
|
||||
|
||||
JDCloud
|
||||
|
||||
#### Plugin description
|
||||
|
||||
JdCloud Container Service supports binding an Elastic Public IP directly to a pod in Kubernetes, allowing the pod to communicate directly with the external network.
|
||||
- The cluster's network plugin uses Yunjian-CNI and cannot use Flannel to create the cluster.
|
||||
- For specific usage restrictions of Elastic Public IPs, please refer to the JdCloud Elastic Public IP product documentation.
|
||||
- Install the EIP-Controller component.
|
||||
- The Elastic Public IP will not be deleted when the pod is destroyed.
|
||||
|
||||
#### Network parameters
|
||||
|
||||
BandwidthConfigName
|
||||
- Meaning:The bandwidth of the Elastic Public IP, measured in Mbps, has a value range of [1, 1024].
|
||||
- Value:Must be an integer
|
||||
- Configurable:Y
|
||||
|
||||
ChargeTypeConfigName
|
||||
- Meaning:The billing method for the Elastic Public IP
|
||||
- Value:string, `postpaid_by_usage`/`postpaid_by_duration`
|
||||
- Configurable:Y
|
||||
|
||||
FixedEIPConfigName
|
||||
- Meaning:Whether to fixed the Elastic Public IP,if so, the EIP will not be changed when the pod is recreated.
|
||||
- Value:string, "false" / "true"
|
||||
- Configurable:Y
|
||||
|
||||
AssignEIPConfigName
|
||||
- Meaning:Whether to designate a specific Elastic Public IP. If true, provide the ID of the Elastic Public IP; otherwise, an EIP will be automatically allocated.
|
||||
- Value:string, "false" / "true"
|
||||
|
||||
EIPIdConfigName
|
||||
- Meaning:If a specific Elastic Public IP is designated, the ID of the Elastic Public IP must be provided, and the component will automatically perform the lookup and binding.
|
||||
- Value:string,for example:`fip-xxxxxxxx`
|
||||
|
||||
#### Example
|
||||
|
||||
```yaml
|
||||
apiVersion: game.kruise.io/v1alpha1
|
||||
kind: GameServerSet
|
||||
metadata:
|
||||
name: eip
|
||||
namespace: default
|
||||
spec:
|
||||
gameServerTemplate:
|
||||
spec:
|
||||
containers:
|
||||
- image: gss-cn-north-1.jcr.service.jdcloud.com/gsshosting/pal:v1
|
||||
name: game-server
|
||||
network:
|
||||
networkType: JdCloud-EIP
|
||||
networkConf:
|
||||
- name: "BandWidth"
|
||||
value: "10"
|
||||
- name: "ChargeType"
|
||||
value: postpaid_by_usage
|
||||
- name: "Fixed"
|
||||
value: "false"
|
||||
replicas: 3
|
||||
```
|
||||
|
||||
Check the network status in GameServer:
|
||||
|
||||
```yaml
|
||||
networkStatus:
|
||||
createTime: "2024-11-04T10:53:14Z"
|
||||
currentNetworkState: Ready
|
||||
desiredNetworkState: Ready
|
||||
externalAddresses:
|
||||
- ip: xxx.xxx.xxx.xxx
|
||||
internalAddresses:
|
||||
- ip: 10.0.0.95
|
||||
lastTransitionTime: "2024-11-04T10:53:14Z"
|
||||
networkType: JdCloud-EIP
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Network Isolation
|
||||
|
||||
Consider the following scenarios, such as:
|
||||
|
|
|
|||
Loading…
Reference in New Issue