All Products
Search
Document Center

Elastic Container Instance:Limit the inbound and outbound bandwidth of pods

Last Updated:Apr 01, 2026

Set maximum inbound and outbound bandwidth for Elastic Container Instance (ECI)-based pods to ensure network stability, security, and quality of service (QoS), and prevent any single pod from consuming excessive bandwidth.

How it works

Bandwidth limits are applied via annotations on the pod metadata. The two supported annotations are:

AnnotationDirectionDescription
kubernetes.io/ingress-bandwidthInboundMaximum inbound (ingress) bandwidth
kubernetes.io/egress-bandwidthOutboundMaximum outbound (egress) bandwidth

Unit conversion: Annotation values use storage-style units (B, K, KB, M, MB, G, GB, T, or TB). ECI interprets the value as bytes per second (Bps) and converts it to a network bandwidth rate. For example, 40M is treated as 40 MBps, which equals 320 Mbit/s. If you omit the unit, ECI defaults to B (bytes).

Important

Bandwidth annotations only take effect when a pod is created. If you add or modify these annotations on an existing pod, the changes are ignored.

Set bandwidth limits on a pod

Add the bandwidth annotations in the metadata.annotations section of your pod spec. For a Deployment, place the annotations in spec.template.metadata.annotations — not in the top-level metadata of the Deployment itself.

The following example creates a Deployment with a 40 M ingress limit and a 10 M egress limit:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: test
  labels:
    app: test
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      name: nginx-test
      labels:
        app: nginx
        alibabacloud.com/eci: "true"
      annotations:
        kubernetes.io/ingress-bandwidth: 40M    # Limit inbound bandwidth to 320 Mbit/s
        kubernetes.io/egress-bandwidth: 10M     # Limit outbound bandwidth of the pod
    spec:
      containers:
      - name: nginx
        image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
        ports:
        - containerPort: 80

Limitations

LimitationDetails
Annotations take effect at creation onlyAdding or modifying kubernetes.io/ingress-bandwidth or kubernetes.io/egress-bandwidth on an existing pod has no effect.
Annotation placementFor Deployments and other workload controllers, always add bandwidth annotations in spec.template.metadata.annotations. Annotations in the top-level Deployment metadata do not affect the pods.