Skip to content

Commit 929df81

Browse files
committed
SpiderMultusConfig: Fix error json tag for min/maxTxRateMbps (spidernet-io#4716)
Signed-off-by: Cyclinder Kuo <[email protected]> Signed-off-by: cyclinder <[email protected]>
1 parent 4302a80 commit 929df81

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

docs/usage/spider-multus-config-zh_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ spec:
305305
config: '{"cniVersion":"0.3.1","name":"sriov-rdma","plugins":[{"vlan":100,"type":"sriov","ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
306306
```
307307

308-
- 配置 Sriov 网络带宽
308+
- 限制 Sriov VF 传输带宽
309309

310-
我们可通过 SpiderMultusConfig 配置 Sriov 的网络带宽:
310+
我们可通过 SpiderMultusConfig 限制 Sriov VF 传输带宽:
311311

312312
```bash
313313
cat <<EOF | kubectl apply -f -
@@ -323,11 +323,11 @@ spec:
323323
resourceName: spidernet.io/sriov_netdeivce
324324
vlanID: 100
325325
minTxRateMbps: 100
326-
MaxTxRateMbps: 1000
326+
maxTxRateMbps: 1000
327327
EOF
328328
```
329329

330-
> `minTxRateMbps``MaxTxRateMbps` 配置此 CNI 配置文件的网络传输带宽范围为: [100,1000]
330+
> `minTxRateMbps``maxTxRateMbps` 配置此 CNI 配置文件的网络传输带宽范围为: [100,1000]
331331

332332
创建后,查看对应的 Multus NetworkAttachmentDefinition CR:
333333

@@ -348,7 +348,7 @@ metadata:
348348
name: sriov-bandwidth
349349
uid: b08ce054-1ae8-414a-b37c-7fd6988b1b8e
350350
spec:
351-
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","minTxRate": 100, "maxTxRate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
351+
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","min_tx_rate": 100, "max_tx_rate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
352352
```
353353

354354
### Ifacer 使用配置

docs/usage/spider-multus-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ spec:
329329
EOF
330330
```
331331
332-
> minTxRateMbps and MaxTxRateMbps configure the transmission bandwidth range for pods created with this configuration: [100,1000].
332+
> minTxRateMbps and maxTxRateMbps configure the transmission bandwidth range for pods created with this configuration: [100,1000].
333333
334334
After creation, check the corresponding Multus NetworkAttachmentDefinition CR:
335335
@@ -350,7 +350,7 @@ metadata:
350350
name: sriov-bandwidth
351351
uid: b08ce054-1ae8-414a-b37c-7fd6988b1b8e
352352
spec:
353-
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","minTxRate": 100, "maxTxRate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
353+
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","min_tx_rate": 100, "max_tx_rate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
354354
```
355355
356356
### Ifacer Configurations

pkg/constant/k8s.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const (
170170
IPoIBCNI = "ipoib"
171171
OvsCNI = "ovs"
172172
CustomCNI = "custom"
173+
TuningCNI = "tuning"
173174
)
174175

175176
const WebhookMutateRoute = "/webhook-health-check"

pkg/multuscniconfig/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ type IPvlanNetConf struct {
5050
type SRIOVNetConf struct {
5151
Vlan *int32 `json:"vlan,omitempty"`
5252
// Mbps, 0 = disable rate limiting
53-
MinTxRate *int `json:"minTxRate,omitempty"`
53+
MinTxRate *int `json:"min_tx_rate,omitempty"`
5454
// Mbps, 0 = disable rate limiting
55-
MaxTxRate *int `json:"maxTxRate,omitempty"`
55+
MaxTxRate *int `json:"max_tx_rate,omitempty"`
5656
Type string `json:"type"`
5757
DeviceID string `json:"deviceID,omitempty"`
5858
IPAM *spiderpoolcmd.IPAMConfig `json:"ipam,omitempty"`

0 commit comments

Comments
 (0)