Skip to content

Commit cefb56f

Browse files
authored
SpiderMultusConfig: Fix error json tag for min/maxTxRateMbps (#4716) (#4737)
Signed-off-by: Cyclinder Kuo <[email protected]> Signed-off-by: cyclinder <[email protected]>
1 parent e409183 commit cefb56f

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
@@ -253,9 +253,9 @@ spec:
253253
config: '{"cniVersion":"0.3.1","name":"sriov-rdma","plugins":[{"vlan":100,"type":"sriov","ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
254254
```
255255

256-
- 配置 Sriov 网络带宽
256+
- 限制 Sriov VF 传输带宽
257257

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

260260
```bash
261261
cat <<EOF | kubectl apply -f -
@@ -271,11 +271,11 @@ spec:
271271
resourceName: spidernet.io/sriov_netdeivce
272272
vlanID: 100
273273
minTxRateMbps: 100
274-
MaxTxRateMbps: 1000
274+
maxTxRateMbps: 1000
275275
EOF
276276
```
277277

278-
> `minTxRateMbps``MaxTxRateMbps` 配置此 CNI 配置文件的网络传输带宽范围为: [100,1000]
278+
> `minTxRateMbps``maxTxRateMbps` 配置此 CNI 配置文件的网络传输带宽范围为: [100,1000]
279279
280280
创建后,查看对应的 Multus NetworkAttachmentDefinition CR:
281281

@@ -296,7 +296,7 @@ metadata:
296296
name: sriov-bandwidth
297297
uid: b08ce054-1ae8-414a-b37c-7fd6988b1b8e
298298
spec:
299-
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","minTxRate": 100, "maxTxRate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
299+
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"}]}'
300300
```
301301

302302
### Ifacer 使用配置

docs/usage/spider-multus-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ spec:
275275
EOF
276276
```
277277

278-
> minTxRateMbps and MaxTxRateMbps configure the transmission bandwidth range for pods created with this configuration: [100,1000].
278+
> minTxRateMbps and maxTxRateMbps configure the transmission bandwidth range for pods created with this configuration: [100,1000].
279279
280280
After creation, check the corresponding Multus NetworkAttachmentDefinition CR:
281281

@@ -296,7 +296,7 @@ metadata:
296296
name: sriov-bandwidth
297297
uid: b08ce054-1ae8-414a-b37c-7fd6988b1b8e
298298
spec:
299-
config: '{"cniVersion":"0.3.1","name":"sriov-bandwidth","plugins":[{"vlan":100,"type":"sriov","minTxRate": 100, "maxTxRate": 1000,"ipam":{"type":"spiderpool"}},{"type":"rdma"},{"type":"coordinator"}]}'
299+
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"}]}'
300300
```
301301

302302
### Ifacer Configurations

pkg/constant/k8s.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const (
157157
IPoIBCNI = "ipoib"
158158
OvsCNI = "ovs"
159159
CustomCNI = "custom"
160+
TuningCNI = "tuning"
160161
)
161162

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

pkg/multuscniconfig/utils.go

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

0 commit comments

Comments
 (0)