Skip to content

Commit 55d7153

Browse files
authored
Merge pull request kubernetes#81165 from johscheuer/update-traffic-shaping-docs
Update internal traffic shaping docs
2 parents b1ad887 + a9cf6ce commit 55d7153

File tree

1 file changed

+10
-8
lines changed
  • pkg/kubelet/dockershim/network/cni

1 file changed

+10
-8
lines changed

pkg/kubelet/dockershim/network/cni/cni.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ type cniPortMapping struct {
9494
// see: https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md and
9595
// https://github.com/containernetworking/plugins/blob/master/plugins/meta/bandwidth/README.md
9696
type cniBandwidthEntry struct {
97-
// IngressRate is the bandwidth rate in bits per second for traffic through container. 0 for no limit. If ingressRate is set, ingressBurst must also be set
97+
// IngressRate is the bandwidth rate in bits per second for traffic through container. 0 for no limit. If IngressRate is set, IngressBurst must also be set
9898
IngressRate int `json:"ingressRate,omitempty"`
99-
// IngressBurst is the bandwidth burst in bits for traffic through container. 0 for no limit. If ingressBurst is set, ingressRate must also be set
100-
// NOTE: it's not used for now and default to 0.
99+
// IngressBurst is the bandwidth burst in bits for traffic through container. 0 for no limit. If IngressBurst is set, IngressRate must also be set
100+
// NOTE: it's not used for now and defaults to 0. If IngressRate is set IngressBurst will be math.MaxInt32 ~ 2Gbit
101101
IngressBurst int `json:"ingressBurst,omitempty"`
102-
// EgressRate is the bandwidth is the bandwidth rate in bits per second for traffic through container. 0 for no limit. If egressRate is set, egressBurst must also be set
102+
// EgressRate is the bandwidth is the bandwidth rate in bits per second for traffic through container. 0 for no limit. If EgressRate is set, EgressBurst must also be set
103103
EgressRate int `json:"egressRate,omitempty"`
104-
// EgressBurst is the bandwidth burst in bits for traffic through container. 0 for no limit. If egressBurst is set, egressRate must also be set
105-
// NOTE: it's not used for now and default to 0.
104+
// EgressBurst is the bandwidth burst in bits for traffic through container. 0 for no limit. If EgressBurst is set, EgressRate must also be set
105+
// NOTE: it's not used for now and defaults to 0. If EgressRate is set EgressBurst will be math.MaxInt32 ~ 2Gbit
106106
EgressBurst int `json:"egressBurst,omitempty"`
107107
}
108108

@@ -438,11 +438,13 @@ func (plugin *cniNetworkPlugin) buildCNIRuntimeConf(podName string, podNs string
438438
// https://github.com/containernetworking/plugins/blob/master/plugins/meta/bandwidth/README.md
439439
// Rates are in bits per second, burst values are in bits.
440440
bandwidthParam.IngressRate = int(ingress.Value())
441-
bandwidthParam.IngressBurst = math.MaxInt32 // no limit
441+
// Limit IngressBurst to math.MaxInt32, in practice limiting to 2Gbit is the equivalent of setting no limit
442+
bandwidthParam.IngressBurst = math.MaxInt32
442443
}
443444
if egress != nil {
444445
bandwidthParam.EgressRate = int(egress.Value())
445-
bandwidthParam.EgressBurst = math.MaxInt32 // no limit
446+
// Limit EgressBurst to math.MaxInt32, in practice limiting to 2Gbit is the equivalent of setting no limit
447+
bandwidthParam.EgressBurst = math.MaxInt32
446448
}
447449
rt.CapabilityArgs[bandwidthCapability] = bandwidthParam
448450
}

0 commit comments

Comments
 (0)