Instead of enumerating specific Elastic Compute Service (ECS) instance types, you can specify vCPU and memory requirements and let Elastic Container Instance (ECI) select the underlying architecture automatically. The compute category feature lets you express a preference for cost or performance in that selection.
Two categories are available:
Economy — lower vCPU unit price than general, supports 0.25–8 vCPUs. Best for lightweight, batch, or cost-sensitive workloads.
General — same unit price as instances created without a compute category, supports 1–64 vCPUs. Delivers higher performance for the same vCPU and memory specs.
Both compute categories are in public preview.
The default temporary storage for both categories is 30 GiB.
Choose a compute category
| Goal | Category |
|---|---|
| Reduce cost for simple or non-critical workloads | economy |
| Maximize performance for production workloads | general |
| Improve availability (tolerate minor performance variation) | Specify both: general,economy |
When you specify multiple categories, the system tries each combination in order (spec priority first, then category). This lets the system fall back to economy if general resources are unavailable — keeping the pod running at the cost of a minor performance trade-off.
Specifications
Economy
Supported in all regions where ECI is available
| vCPU | Memory (GiB) | Baseline bandwidth (bidirectional, Gbit/s) |
|---|---|---|
| 0.25 | 0.5, 1 | 0.08 |
| 0.5 | 1, 2 | 0.08 |
| 1 | 2, 4, 8 | 0.08 |
| 2 | 1, 2, 4, 8, 16 | 0.2 |
| 4 | 2, 4, 8, 16, 32 | 0.4 |
| 8 | 4, 8, 16, 32, 64 | 0.8 |
Supported only in some regions
The following specs are only available in: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and Singapore.
These specs cannot be used to create preemptible instances.
| vCPU | Memory (GiB) | Baseline bandwidth (bidirectional, Gbit/s) |
|---|---|---|
| 2 | 6, 10, 12, 14 | 0.2 |
| 4 | 6, 10, 12, 14, 18, 20, 22, 24, 26, 28, 30 | 0.4 |
| 6 | 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48 | 0.8 |
| 8 | 10, 12, 14, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62 | 0.8 |
General
Supported in all regions where ECI is available
| vCPU | Memory (GiB) | Baseline bandwidth (bidirectional, Gbit/s) |
|---|---|---|
| 1 | 2, 4, 8 | 1 |
| 2 | 1, 2, 4, 8, 16 | 1 |
| 4 | 2, 4, 8, 16, 32 | 1.5 |
| 8 | 4, 8, 16, 32, 64 | 2 |
| 12 | 12, 24, 48, 96 | 2.5 |
| 16 | 16, 32, 64, 128 | 3 |
| 24 | 24, 48, 96, 192 | 4.5 |
| 32 | 32, 64, 128, 256 | 6 |
| 52 | 96, 192, 384 | 12.5 |
| 64 | 128, 256, 512 | 20 |
Supported only in some regions
The following specs are only available in: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), and Singapore.
These specs cannot be used to create preemptible instances.
| vCPU | Memory (GiB) | Baseline bandwidth (bidirectional, Gbit/s) |
|---|---|---|
| 2 | 6, 10, 12, 14 | 1 |
| 4 | 6, 10, 12, 14, 18, 20, 22, 24, 26, 28, 30 | 1.5 |
| 6 | 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48 | 1.5 |
| 8 | 10, 12, 14, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62 | 2.5 |
Billing
Both compute categories are in public preview.
The economy category has a lower vCPU unit price than the general category. Memory pricing is the same for both.
| Category | Resource | Unit price |
|---|---|---|
| Economy | vCPU | USD 0.00000424/vCPU-second (USD 0.015264/vCPU-hour) |
| Economy | Memory | USD 0.00000096/GiB-second (USD 0.003456/GiB-hour) |
| General | vCPU | USD 0.0000077/vCPU-second (USD 0.02772/vCPU-hour) |
| General | Memory | USD 0.00000096/GiB-second (USD 0.003456/GiB-hour) |
After the pod is created, run kubectl describe pod to confirm the actual compute category used. The k8s.aliyun.com/eci-instance-compute-category response annotation shows the result — billing is based on that category's unit prices.
Limitations
vCPU/memory specs required. This feature only works when creating elastic container instances by specifying vCPU and memory. If you specify ECS instance types, they take precedence and the compute category is ignored.
Preemptible pods not supported. Setting both a preemptible annotation and a compute category annotation returns error
FeatureBasedConstraintConflict.Arm-based pods not supported. Scheduling a pod on an Arm-based virtual node with an economy compute category annotation returns error
FeatureBasedConstraintConflict.Incompatible features. Cannot be used together with:
Specify or exclude ECS instance families
Specify or exclude specific generations of ECS instance families
Configure the compute category
Step 1: Specify vCPU and memory
Before setting a compute category, specify the pod's vCPU and memory using one of these methods:
| Method | How | Notes |
|---|---|---|
| Per-container limits (recommended) | Set resources.limits.cpu and resources.limits.memory for each container | ECI uses limits to determine the instance spec. Using limits gives you explicit control over the instance size selected. |
| Pod-level annotation | Add k8s.aliyun.com/eci-use-specs to the pod's metadata | Specifies the total vCPU and memory for the pod directly, bypassing per-container aggregation. |
If none oflimits,requests, ork8s.aliyun.com/eci-use-specsare set, or if all three are set simultaneously, see Configuration description for how the system resolves the spec.
Step 2: Set the compute category
Add the k8s.aliyun.com/eci-compute-category annotation to the pod's metadata section.
Valid values:
economy,generalTo specify a fallback order, use a comma-separated list:
general,economy
Add annotations to the pod's
metadatasection. For a Deployment, this isspec.template.metadata.Annotations take effect only at pod creation. Adding or modifying annotations on an existing pod has no effect.
How spec selection works
When both vCPU/memory specs and a compute category are configured, ECI determines the final instance using these rules:
| Configuration | Result |
|---|---|
| Compute category specified, no vCPU/memory | Creates an instance with 2 vCPUs and 4 GiB of memory using the specified category |
| vCPU/memory + compute category specified, combination is a valid ECI spec | Creates the instance as specified |
vCPUs < 1 with general category | System auto-adjusts vCPUs to 1 (minimum for general) |
vCPUs > 8 with economy category | Invalid — system cannot auto-adjust; returns an error |
| vCPUs within the category's range but not an exact ECI spec | System rounds up to the nearest supported spec (greater than or equal to the requested values). Example: 7 vCPU / 13 GiB + general is adjusted to 8 vCPU / 16 GiB |
| Multiple specs or categories specified | Instance specs take priority over categories. The system tries combinations in the order specified. |
Multiple specs and categories
When you specify multiple values for both, the system iterates through all combinations by spec first, then category. Invalid combinations (for example, 16 vCPU + economy) are automatically skipped.
Example: k8s.aliyun.com/eci-use-specs: "4-8Gi,8-16Gi,16-32Gi" and k8s.aliyun.com/eci-compute-category: "general,economy"
The system tries in this order:
4 vCPU / 8 GiB, general
4 vCPU / 8 GiB, economy
8 vCPU / 16 GiB, general
8 vCPU / 16 GiB, economy
16 vCPU / 32 GiB, general
16 vCPU / 32 GiB, economy *(invalid — auto-skipped)*
When a requested spec doesn't exactly match any supported ECI spec, the system considers all specified categories and rounds up to the nearest valid spec. If that rounded spec is incompatible with a given category, that category is excluded from the selection for this spec. Example: 0.5 vCPU / 1.9 GiB + general,economy — the system rounds up to 0.5 vCPU / 2 GiB. Because 0.5 vCPU is not supported by general, only economy is used for this spec.
Configuration examples
Example 1: Economy category with per-container limits
Use limits on each container and set the compute category to economy. The pod's total vCPU and memory are summed across containers.
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
labels:
app: test
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
name: test
labels:
app: nginx
alibabacloud.com/eci: "true"
annotations:
k8s.aliyun.com/eci-compute-category: "economy"
spec:
containers:
- name: nginx
image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
ports:
- containerPort: 80
resources:
limits:
cpu: "500m" # 0.5 vCPU
memory: "1024Mi" # 1 GiB
- name: busybox
image: registry.cn-shanghai.aliyuncs.com/eci_open/busybox:1.30
command: ["sleep"]
args: ["999999"]
resources:
limits:
cpu: "1000m" # 1 vCPU
memory: "2048Mi" # 2 GiBExample 2: General with economy fallback
Set general,economy to prefer high performance but fall back to economy if general resources are unavailable. This improves availability without requiring a fixed compute category.
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
labels:
app: test
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
name: test
labels:
app: nginx
alibabacloud.com/eci: "true"
annotations:
k8s.aliyun.com/eci-compute-category: "general,economy" # Prefer general; fall back to economy
spec:
containers:
- name: nginx
image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
ports:
- containerPort: 80
resources:
limits:
cpu: "2000m" # 2 vCPUs
memory: "4096Mi" # 4 GiB
- name: busybox
image: registry.cn-shanghai.aliyuncs.com/eci_open/busybox:1.30
command: ["sleep"]
args: ["999999"]
resources:
limits:
cpu: "2000m" # 2 vCPUs
memory: "4096Mi" # 4 GiBExample 3: Multiple specs with economy category
Use k8s.aliyun.com/eci-use-specs to specify multiple pod-level specs with a fallback order, combined with a single compute category.
apiVersion: apps/v1
kind: Deployment
metadata:
name: test
labels:
app: test
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
name: test
labels:
app: nginx
alibabacloud.com/eci: "true"
annotations:
k8s.aliyun.com/eci-use-specs: "2-4Gi,4-8Gi" # Try 2 vCPU/4 GiB first, then 4 vCPU/8 GiB
k8s.aliyun.com/eci-compute-category: "economy"
spec:
containers:
- name: nginx
image: registry.cn-shanghai.aliyuncs.com/eci_open/nginx:1.14.2
ports:
- containerPort: 80