All Documents
Current Document

Content is empty

If you don't find the content you expect, please try another search term

Documentation

Configure bandwidth limits for KCI pods

Last updated:2021-08-30 17:19:27

This topic describes how to configure inbound and outbound bandwidth limits for KCI pods.

Configure bandwidth limits by KCI pod

Use API operations

When you create a KCI pod, you can set the IngressBandwidth and EgressBandwidth parameters in the CreateContainerGroup API operation to configure inbound and outbound bandwidth limits for the pod.

Parameter Type Required Description
IngressBandwidth Long No The inbound bandwidth limit of the KCI pod, in Mbit/s. Maximum value: 1,024.
EgressBandwidth Long No The outbound bandwidth limit of the KCI pod, in Mbit/s. Maximum value: 1,024.

Use pod annotations

When you create a resource in a cluster, you can define annotations to configure inbound and outbound bandwidth limits for a specific KCI pod.

Annotation key Required Sample annotation value Description
kubernetes.io/ingress-bandwidth No 100M The inbound bandwidth limit of the KCI pod, in Gbit/s, Mbit/s, or kbit/s. If no unit is specified, the bandwidth limit is measured in bit/s by default.
Valid values: 1–1,024 Mbit/s. Default value: 1,024 Mbit/s.
kubernetes.io/egress-bandwidth No 100M The outbound bandwidth limit of the KCI pod, in Gbit/s, Mbit/s, or kbit/s. If no unit is specified, the bandwidth limit is measured in bit/s by default.
Valid values: 1–1,024 Mbit/s. Default value: 1,024 Mbit/s.

Example

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
        annotations:
          kubernetes.io/ingress-bandwidth: "100M" # Valid values: 1–1,024 Mbit/s.
          kubernetes.io/egress-bandwidth: "200M" # Valid values: 1–1,024 Mbit/s.
        labels:
          app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
      nodeName: virtual-node

Configure bandwidth limits by virtual node

You can use a ConfigMap to configure bandwidth limits for all KCI pods on a specific virtual node.

Example

When you connect a KCI pod to a Kubernetes cluster by deploying Virtual Kubelet, you need to add --provider-configmap=virtual-kubelet-conf to the startup parameters of Virtual Kubelet. Sample ConfigMap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: virtual-kubelet-conf
  namespace: kube-system
data:
  kci.yaml: |
    instance:
      networkIngress: "200M" # Valid values: 1–1,024 Mbit/s.
      networkEgress: "100M" # Valid values: 1–1,024 Mbit/s.

In a serverless cluster, the ConfigMap name must be the same as the Virtual Kubelet node name.

Note:

  1. The bandwidth limits specified in pod annotations take priority over those configured by virtual node. If bandwidth limits are neither specified in pod annotations nor configured by virtual node, 1,024 Mbit/s is specified as the default bandwidth limits.
  2. Bandwidth limits can be measured in Gbit/s, Mbit/s, or kbit/s. If no unit is specified, the bandwidth limits are measured in bit/s by default. The valid value range is 1–1,024 Mbit/s.
On this page
Pure ModeNormal Mode

Pure Mode

Click to preview the document content in full screen
Feedback