<p>Setting the following pod configuration will enforce BW usage of 10MB on average or also prevent spikes of over 10MB.  If this does not prevent spikes.  Is there a way to configure CNI to &quot;level off&quot; spikes so it will queue the data and will send over a period of few seconds and within the BW limit of 10MB.</p>
<pre><code>kubernetes.io/ingress-bandwidth: 10M    
kubernetes.io/egress-bandwidth: 10M
</code></pre>

<p>There isn't a way to control the burst rate currently.</p>
<p><a href="https://github.com/kubernetes/kubernetes/blob/7735cf7f2674627283db081d61a2c45f4b70ee8f/pkg/kubelet/dockershim/network/cni/cni.go#L427-L443" rel="nofollow noreferrer">Here is the relevant code that implements bandwidth rate and burst</a>. Notice how <code>bandwidthParam.IngressBurst</code> and <code>bandwidthParam.EgressBurst</code> are set to <code>math.MaxInt32</code>.</p>
<pre><code>    if ingress != nil || egress != nil {
        bandwidthParam := cniBandwidthEntry{}
        if ingress != nil {
            // see: https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md and
            // https://github.com/containernetworking/plugins/blob/master/plugins/meta/bandwidth/README.md
            // Rates are in bits per second, burst values are in bits.
            bandwidthParam.IngressRate = int(ingress.Value())
            // Limit IngressBurst to math.MaxInt32, in practice limiting to 2Gbit is the equivalent of setting no limit
            bandwidthParam.IngressBurst = math.MaxInt32
        }
        if egress != nil {
            bandwidthParam.EgressRate = int(egress.Value())
            // Limit EgressBurst to math.MaxInt32, in practice limiting to 2Gbit is the equivalent of setting no limit
            bandwidthParam.EgressBurst = math.MaxInt32
        }
        rt.CapabilityArgs[bandwidthCapability] = bandwidthParam
    }
</code></pre>
