When you create pods (elastic container instances) in a Kubernetes cluster, you can add annotations to the pods to use all features of Elastic Container Instance. Make sure that the annotations that you want to add comply with the Kubernetes syntax. This topic describes the annotations that you can add when you create a pod. This topic also describes the annotations that you can add after the system schedules resources and creates pods.
Annotations that you can add when you create pods
The following tables describe the annotations that you can add when you create Elastic Container Instance-based pods.
The annotations described in the following table are applicable only to the pods that are scheduled to VNodes. These pods run as elastic container instances. The annotations cannot be added to the pods that are scheduled to real nodes.
Annotations must be added to the metadata of the configuration file of the pods. For example, when you create a Deployment, you must add annotations in the spec.template.metadata section.
To use features of Elastic Container Instance, you can add annotations only when you create Elastic Container Instance-based pods. If you add or modify annotations when you update pods, these annotations do not take effect.
Annotations that you can add after the system schedules resources and creates pods
The following table describes the annotations that you can add after the system schedules resources and creates pods. You can run the kubectl describe
command to query the details of the pods.
Annotation | Example | Description |
k8s.aliyun.com/eci-request-id | 45942504-4688-51BA-BBAB-4B692C4F39C0 | Indicates the request ID. |
k8s.aliyun.com/eci-instance-id | eci-2ze1y0la40qgva09**** | Indicates the pod ID. |
k8s.aliyun.com/eci-instance-spec | 2.0-4.0Gi | Indicates the specifications of the pod. You are charged based on the value.
|
k8s.aliyun.com/allocated-eipInstanceId | eip-bp1q5n8cq4p7f6dzu**** | Indicates the EIP ID. |
k8s.aliyun.com/allocated-eipAddress | 47.99.**.** | Indicates the EIP that is associated with the instance. |
k8s.aliyun.com/allocated-ipv6Address | 2001:d**:1:1:1:1:1:1 | Indicates the IPv6 address that is assigned to the pod. |
k8s.aliyun.com/eci-created-by-template | true | Indicates whether a template was used to create the pod. |
k8s.aliyun.com/eni-instance-id | eni-2ze6d7oo5ukqj26o**** | Indicates the ID of the elastic network interface (ENI) that is bound to the pod. |
k8s.aliyun.com/eci-vpc | vpc-2zeghwzptn5zii0w7**** | Indicates the virtual private cloud (VPC) to which the pod belongs. |
k8s.aliyun.com/eci-matched-image-cache | imc-2zedy3v37800iimu**** | Indicates the ID of the matched image cache. |
k8s.aliyun.com/eci-schedule-result | finished | Indicates the scheduling result. This annotation is retired. For information about pod scheduling results, see ContainerInstanceCreated. |