All Products
Search
Document Center

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

Last Updated:Sep 21, 2026

Set per-pod bandwidth limits to enforce Quality of Service (QoS), improve network stability, and tighten security.

How it works

Add kubernetes.io/ingress-bandwidth and kubernetes.io/egress-bandwidth annotations to the pod metadata in your workload manifest. ECI reads these annotations at pod creation time and applies the corresponding bandwidth limits.

Prerequisites

Before you begin, ensure that you have:

  • An Elastic Container Instance (ECI)-based pod or workload to configure

  • Permission to create or deploy workloads in your cluster

Set bandwidth limits

Add the following annotations to the pod metadata:

AnnotationDescription
kubernetes.io/ingress-bandwidthMaximum inbound bandwidth
kubernetes.io/egress-bandwidthMaximum outbound bandwidth

Supported units: TB, T, GB, G, MB, M, KB, K, B. If no unit is specified, B (bytes) is used by default.

The annotation value represents bytes per second. The system converts it to the equivalent bit-rate. For example:

Annotation valueActual bandwidth
40M320 Mbit/s
10M80 Mbit/s

Example: Deployment with bandwidth limits

For a Deployment, add the annotations in the spec.template.metadata section:

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 the inbound bandwidth of the pod.
        kubernetes.io/egress-bandwidth: 10M     # Limit the outbound bandwidth of the pod.
    spec:
      containers:
      - name: nginx
        image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
        ports:
        - containerPort: 80

Usage notes

  • Annotations must be in the pod metadata, not the top-level workload metadata. For a Deployment, this is spec.template.metadata.

  • Bandwidth annotations only take effect when a pod is created. Adding or modifying annotations on an existing pod has no effect.