Add annotations to pods running as Elastic Container Instances (ECIs) to enable specific ECI features—such as spot pricing, fixed IPs, image caches, and Elastic IP Address (EIP) binding. This page lists all supported annotations grouped by category, and identifies which annotations you add at pod creation time versus which the system generates after scheduling.
Usage notes
-
Annotations apply only to pods scheduled to virtual nodes. They have no effect on pods scheduled to real nodes.
-
Add annotations to
spec.template.metadata.annotationsin your workload manifest. For example, when you create a Deployment, add annotations in thespec.template.metadatasection. -
Annotations take effect only when a pod is created. Adding or modifying annotations on an existing pod has no effect.
Example: Deployment with ECI annotations
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations: # Annotations go here, not at the Deployment level
k8s.aliyun.com/eci-use-specs: "2-4Gi" # Pod size: 2 vCPU, 4 GiB memory
k8s.aliyun.com/eci-spot-strategy: SpotAsPriceGo # Use spot pricing
spec:
containers:
- name: nginx
image: nginx:latest
Annotations you can add when creating pods
Annotations added after scheduling
After the system schedules resources and creates a pod, these annotations are automatically added. Run kubectl describe pod <pod-name> to view them.
| Annotation | Example | Description |
|---|---|---|
k8s.aliyun.com/eci-request-id |
45942504-4688-51BA-BBAB-4B692C4F39C0 |
Request ID for the pod creation call. |
k8s.aliyun.com/eci-instance-id |
eci-2ze1y0la40qgva09**** |
ECI instance ID of the pod. |
k8s.aliyun.com/eci-instance-spec |
2.0-4.0Gi |
Actual specifications of the pod. If the value is a vCPU-memory pair (e.g., 2.0-4.0Gi), billing is based on vCPU and memory. If the value is an ECS instance type (e.g., ecs.c6.large), billing is based on that instance type. |
k8s.aliyun.com/eci-instance-compute-category |
economy |
Compute category of the ECS instance type used for the pod. economy: billed at economy category rates. general: billed at general category rates. |
k8s.aliyun.com/allocated-eipInstanceId |
eip-bp1q5n8cq4p7f6dzu**** |
ID of the EIP associated with the instance. |
k8s.aliyun.com/allocated-eipAddress |
47.99.. |
Public IP address of the associated EIP. |
k8s.aliyun.com/allocated-ipv6Address |
2001:d**:1:1:1:1:1:1 |
IPv6 address assigned to the pod. |
k8s.aliyun.com/eci-created-by-template |
true |
Whether the pod was created from a template. |
k8s.aliyun.com/eni-instance-id |
eni-2ze6d7oo5ukqj26o**** |
ID of the elastic network interface (ENI) bound to the pod. |
k8s.aliyun.com/eci-vpc |
vpc-2zeghwzptn5zii0w7**** |
ID of the VPC the pod belongs to. |
k8s.aliyun.com/eci-matched-image-cache |
imc-2zedy3v37800iimu**** |
ID of the image cache matched during pod creation. |
k8s.aliyun.com/eci-schedule-result |
finished |
Scheduling result. Retired. For current pod scheduling status, see ContainerInstanceCreated. |