All Products
Search
Document Center

Container Compute Service:Pod annotation reference

Last Updated:Jul 01, 2026

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

network.alibabacloud.com/vswitch-ids

"vsw-slw1*,vsw-lkjwo*"

The vSwitch IDs for the pod. Specify multiple IDs to create pods across zones. See Specify vSwitches and security groups for pods.

Important
  • When both vSwitches and affinity are set, ACS uses the specified vSwitches and ignores the affinity configuration.

  • If the pod uses a PersistentVolumeClaim (PVC) with WaitForFirstConsumer binding mode, also specify the target zone in the pod's affinity settings so the scheduler can match the PVC zone to the vSwitch and prevent the pod from staying in the Pending state. See Node affinity scheduling.

network.alibabacloud.com/security-group-ids

"sg-sljwo*,sg-lwirp*"

The security group IDs for the pod. Specify multiple IDs to attach multiple security groups.

network.alibabacloud.com/custom-dnsconfig

{"servers":["20.1.xx.xx","30.1.xx.xx"],"searches":["xx.com","yy.com"],"options":["ndots:2","edns0"]}

Custom DNS configuration for the pod. See Configure custom DNS using annotations.

alibabacloud.com/enable-network-policy-agent

"true"

Enables NetworkPolicy for the pod. Default: false. See Use network policies in ACS clusters.

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

network.alibabacloud.com/pod-with-eip

"true"

Specifies whether to automatically create and attach an EIP to the pod. Valid values: true or false.

network.alibabacloud.com/pod-eip-instanceid

"eip-bp14q***"

Uses an existing EIP. Enter the EIP instance ID. See Apply for an EIP.

network.alibabacloud.com/eip-bandwidth

"5"

Maximum bandwidth of the EIP, in Mbit/s.

network.alibabacloud.com/eip-internet-charge-type

"PayByTraffic"

Billing method for EIP data transfer. Valid values: PayByTraffic (default) | PayByBandwidth. See EIP billing methods.

network.alibabacloud.com/eip-instance-charge-type

"PrePaid"

Billing method for the EIP instance. Valid values: PrePaid (subscription) | PostPaid (pay-as-you-go). See Subscription and Pay-as-you-go.

network.alibabacloud.com/eip-common-bandwidth-package-id

"cbwp-slex***"

Attaches the pod's EIP to an existing Internet Shared Bandwidth instance.

network.alibabacloud.com/eip-isp

"BGP"

Line type of the EIP. Valid values: BGP (BGP Multi-ISP) | BGP_PRO (BGP Multi-ISP Pro). See Apply for an EIP.

network.alibabacloud.com/eip-public-ip-address-pool-id

"pippool-dlsw***"

EIP address pool to allocate the EIP from. See IP address pools.

network.alibabacloud.com/eip-resource-group-id

N/A

Resource group for the EIP. See Apply for an EIP.

network.alibabacloud.com/eip-name

N/A

Name of the EIP.

network.alibabacloud.com/eip-description

N/A

Description of the EIP.

network.alibabacloud.com/eip-security-protection-types

N/A

Security services to apply to the EIP. Separate multiple values with a comma (,). See Apply for an EIP.

network.alibabacloud.com/pod-eip-release-strategy

"Never"

Release policy for the pod's EIP when the pod is deleted. Valid values:

  • Follow: default — the EIP is released when the pod is deleted.

  • Never: the EIP is retained; delete it manually when no longer needed.

  • Go-style duration: for example, 5m30s deletes the EIP 5 minutes and 30 seconds after the pod is deleted.

Image

Parameter

Example

Description

registry.alibabacloud.com/plain-http-registry

"harbor*.pre.com,192.168.XX.XX:5000,reg*.test.com:80"

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.

registry.alibabacloud.com/insecure-registry

"harbor*.pre.com,192.168.XX.XX:5000,reg*.test.com:80"

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:

  • VSwitchOrdered: Schedules pods across vSwitches in the order they are listed.

  • VSwitchRandom: Schedules pods across vSwitches in random order.

Pod failure handling policy

scheduling.alibabacloud.com/fail-strategy

"fail-back"

The failure handling policy for pods. Valid values:

  • fail-back: Automatically recovers from failures. If a pod fails to be created, the system automatically tries to create it again.

  • fail-over: Transfers the pod upon failure. This has the same effect as fail-back.

  • fail-fast: If a pod fails to be created, an error is reported immediately.

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 10-1440. The unit is minutes. The minimum duration is 10 minutes, and the maximum is 1 day. The default value is 4 hours.

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

alibabacloud.com/os-kernel-config

{"transparentHugepageEnabled": "madvise","transparentHugepageShmemEnabled": "advise"}

Transparent Huge Pages settings for the pod's OS. Supported compute classes: GPU and GPU-HPN. Sub-parameters:

  • transparentHugepageEnabled: maps to /sys/kernel/mm/transparent_hugepage/enabled; valid values:

    • always

    • madvise

    • never

  • transparentHugepageShmemEnabled: maps to /sys/kernel/mm/transparent_hugepage/shmem_enabled; valid values:

    • always

    • within_size

    • advise

    • never

    • deny

    • force

Annotations added by ACS

Note

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

network.alibabacloud.com/allocated-eni-id

"eni-esdxs***"

ID of the allocated ENI.

network.alibabacloud.com/vpc-id

"vpc-sljwo***"

ID of the VPC the ENI belongs to.

network.alibabacloud.com/vswitch-id

"vsw-lskdw***"

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

network.alibabacloud.com/allocated-eip-id

"eip-bp1m***"

ID of the allocated EIP.

network.alibabacloud.com/allocated-eip-address

"116.62.***"

IP address of the allocated EIP.

Resource specifications

Parameter

Example value

Description

alibabacloud.com/pod-use-spec

"2.5-5Gi"

Normalized CPU and memory specifications. The format is {xxvCPU}-{xxGiB}.

alibabacloud.com/pod-gpu-use-spec

"1"

Normalized number of GPU cards.

alibabacloud.com/pod-ephemeral-storage

"30Gi"

Normalized ephemeral storage size, in GiB.

Scheduling result

Parameter

Example value

Description

topology.kubernetes.io/region

"cn-hangzhou"

Region where the pod is running.

topology.kubernetes.io/zone

"cn-hangzhou-i"

Zone where the pod is running.

Other metadata

Parameter

Example value

Description

alibabacloud.com/instance-id

"acs-sdsf***"

Instance ID of the ACS pod.

alibabacloud.com/request-id

"6925D4B7-***"

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

k8s.aliyun.com/eci-eip-instanceid

network.alibabacloud.com/pod-eip-instanceid

k8s.aliyun.com/eip-charge-type

network.alibabacloud.com/eip-internet-charge-type