Add annotations to Container Compute Service (ACS) pods to configure networking, image pull behavior, scheduling, and OS settings. This reference lists all supported annotations organized by category.
Annotations for pod configuration
Set these annotations in metadata.annotations when creating a pod or Deployment.
Pod configuration example
apiVersion: v1
kind: Pod
metadata:
name: annotation-pod
annotations:
# Specify one or more vSwitch IDs to control which zones the pod is created in
network.alibabacloud.com/vswitch-ids: "vsw-foo"
# Attach an EIP automatically when the pod starts
network.alibabacloud.com/pod-with-eip: "true"
spec:
...Deployment configuration example
apiVersion: apps/v1
kind: Deployment
metadata:
name: foo
spec:
template:
metadata:
annotations:
network.alibabacloud.com/vswitch-ids: "vsw-foo"
...Network
Parameter | Example | Description |
|
| The vSwitch IDs for the pod. Specify multiple IDs to create pods across zones. See Specify vSwitches and security groups for pods. Important
|
|
| The security group IDs for the pod. Specify multiple IDs to attach multiple security groups. |
|
| Custom DNS configuration for the pod. See Configure custom DNS using annotations. |
|
| Enables NetworkPolicy for the pod. Default: |
EIP configuration
Use the following annotations to attach an elastic IP address (EIP) to a pod. See Attach an EIP to a pod using annotations.
Parameter | Example | Description |
|
| Specifies whether to automatically create and attach an EIP to the pod. Valid values: |
|
| Uses an existing EIP. Enter the EIP instance ID. See Apply for an EIP. |
|
| Maximum bandwidth of the EIP, in Mbit/s. |
|
| Billing method for EIP data transfer. Valid values: |
|
| Billing method for the EIP instance. Valid values: |
|
| Attaches the pod's EIP to an existing Internet Shared Bandwidth instance. |
|
| Line type of the EIP. Valid values: |
|
| EIP address pool to allocate the EIP from. See IP address pools. |
| N/A | Resource group for the EIP. See Apply for an EIP. |
| N/A | Name of the EIP. |
| N/A | Description of the EIP. |
| N/A | Security services to apply to the EIP. Separate multiple values with a comma ( |
|
| Release policy for the pod's EIP when the pod is deleted. Valid values:
|
Image
Parameter | Example | Description |
|
| Registries that use plain HTTP. Configure this to prevent pull failures when an image repository uses HTTP instead of HTTPS. Separate multiple entries with a comma. See Use a self-managed image repository. |
|
| Registries with self-signed certificates. Configure this to skip certificate validation and prevent pull failures. Separate multiple entries with a comma. |
Scheduling
Feature | Parameter | Example | Description |
Pod multi-zone scheduling policy | scheduling.alibabacloud.com/schedule-strategy | "VSwitchOrdered" | The multi-zone scheduling policy. Valid values:
|
Pod failure handling policy | scheduling.alibabacloud.com/fail-strategy | "fail-back" | The failure handling policy for pods. Valid values:
|
Maximum pending duration for a pod | scheduling.alibabacloud.com/max-pending-minute | "10" | The maximum duration a pod can remain in pending state. If the timeout period is exceeded, the system automatically terminates the instance. The value must be an integer in the range The countdown starts when sandbox creation begins. Pods that have not yet reached the sandbox creation stage are not affected by this timeout. |
Operating system
Parameter | Example value | Description |
|
| Transparent Huge Pages settings for the pod's OS. Supported compute classes: GPU and GPU-HPN. Sub-parameters:
|
Annotations added by ACS
ACS writes these annotations to a pod after the pod is created. These annotations reflect runtime allocation results, including elastic network interface (ENI) and EIP assignments. These annotations cannot be set or modified.
ENI allocation
Parameter | Example value | Description |
|
| ID of the allocated ENI. |
|
| ID of the VPC the ENI belongs to. |
|
| ID of the vSwitch the ENI was assigned to. If you specified multiple vSwitches, this shows the one actually used. |
EIP allocation
Parameter | Example value | Description |
|
| ID of the allocated EIP. |
|
| IP address of the allocated EIP. |
Resource specifications
Parameter | Example value | Description |
|
| Normalized CPU and memory specifications. The format is |
|
| Normalized number of GPU cards. |
|
| Normalized ephemeral storage size, in GiB. |
Scheduling result
Parameter | Example value | Description |
|
| Region where the pod is running. |
|
| Zone where the pod is running. |
Other metadata
Parameter | Example value | Description |
|
| Instance ID of the ACS pod. |
|
| Request ID of the pod creation API request. |
Legacy annotation compatibility
The following annotations are supported for backward compatibility. For new deployments, use the recommended replacement annotations listed below.
Legacy annotation | Recommended replacement |
|
|
|
|