ECI-based pods support annotations that activate features not available through standard Kubernetes resource fields. This reference lists all supported annotations, organized by category.
How annotations work
Annotations covered in this reference apply only to pods scheduled to virtual nodes (elastic container instances). They have no effect on pods scheduled to regular nodes.
Annotations take effect only at pod creation time. Adding or modifying annotations on an existing pod has no effect.
Add annotations to spec.template.metadata.annotations in your workload manifest, not to the top-level metadata. The following Deployment shows the correct location:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
annotations:
k8s.aliyun.com/eci-use-specs: "2-4Gi,4-8Gi,ecs.c6.xlarge" # Add ECI annotations here
spec:
containers:
- name: nginx
image: nginxTo inspect annotations on a running pod, run kubectl describe pod <pod-name>.
Annotations added at pod creation
Annotations added by the system
After ECI schedules and creates a pod, the system writes the following read-only annotations. 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**** | Pod ID. |
k8s.aliyun.com/eci-instance-spec | 2.0-4.0Gi | Actual specifications of the pod. If the value is a vCPU-memory combination (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 instance type selected for the pod: economy or general. |
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 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 virtual private cloud (VPC) the pod belongs to. |
k8s.aliyun.com/eci-matched-image-cache | imc-2zedy3v37800iimu**** | ID of the image cache matched for the pod. |
k8s.aliyun.com/eci-schedule-result | finished | (Retired) Scheduling result. Use the ContainerInstanceCreated condition instead. |