
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-08-30 17:19:27
This topic describes how to configure inbound and outbound bandwidth limits for KCI pods.
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. | 
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
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:
Pure Mode