You can use annotations to enable and configure extended features for ACS pods. This topic describes the pod annotations that ACS supports.
Annotations that you can add when you create an ACS pod
You can add annotations to a pod to enable specific features and apply configurations. The following code provides an example.
Pod configuration example
apiVersion: v1
kind: Pod
metadata:
name: annotation-pod
annotations:
network.alibabacloud.com/vswitch-ids: "vsw-foo"
spec:
...Deployment configuration example
apiVersion: apps/v1
kind: Deployment
metadata:
name: foo
...
spec:
...
template:
metadata:
annotations:
network.alibabacloud.com/vswitch-ids: "vsw-foo"
...
Network
Feature | Parameter | Example value | Description |
network.alibabacloud.com/vswitch-ids | "vsw-slw1***,vsw-lkjwo***" | Specifies the vSwitch ID. You can specify multiple vSwitch IDs to create pods in multiple zones. Important When a pod specifies both vSwitches and affinity, ACS prioritizes the specified vSwitches when it creates resources. The affinity configuration is ignored. Important If a pod also uses a PersistentVolumeClaim (PVC) of the WaitForFirstConsumer type, specify the corresponding zone in the pod's affinity settings. The scheduler ensures that the zone allocated to the PVC matches the vSwitch to prevent the pod from becoming pending. For more information, see Node affinity scheduling. | |
network.alibabacloud.com/security-group-ids | "sg-sljwo***,sg-lwirp***" | Specifies the security group ID. You can specify multiple security group IDs. | |
network.alibabacloud.com/custom-dnsconfig | {"servers":["20.1.xx.xx","30.1.xx.xx"],"searches":["xx.com","yy.com"],"options":["ndots:2","edns0"]} | Specifies the custom DNS configuration. | |
alibabacloud.com/enable-network-policy-agent | "true" | Enables NetworkPolicy for ACS pods. The default value is | |
network.alibabacloud.com/pod-with-eip | "true" | Specifies whether to automatically create and attach an EIP. Valid values:
| |
network.alibabacloud.com/pod-eip-instanceid | "eip-bp14q***" | Uses the specified EIP. Enter the EIP instance ID, such as eip-bp14q***. For more information, see Apply for an EIP. | |
k8s.aliyun.com/eci-eip-instanceid (compatible with ECI annotations) | |||
network.alibabacloud.com/eip-bandwidth | "5" | The peak bandwidth of the EIP. Unit: Mbit/s. | |
network.alibabacloud.com/eip-internet-charge-type | "PayByTraffic" | The metering method for the EIP. Valid values:
For more information, see EIP billing methods. | |
k8s.aliyun.com/eip-charge-type (compatible with annotations of earlier versions) | |||
network.alibabacloud.com/eip-instance-charge-type | "PrePaid" | The billing method of the EIP instance. Valid values:
For more information, see Subscription and Pay-as-you-go. | |
network.alibabacloud.com/eip-common-bandwidth-package-id | "cbwp-slex***" | Attaches an existing Internet Shared Bandwidth instance. | |
network.alibabacloud.com/eip-isp | "BGP" | The line type of the EIP. Valid values:
For more information, see Apply for an EIP. | |
network.alibabacloud.com/eip-public-ip-address-pool-id | "pippool-dlsw***" | The EIP address pool. For information about the limits and steps for using EIP address pools, see IP address pools. | |
network.alibabacloud.com/eip-resource-group-id | The resource group of the EIP. For more information, see Apply for an EIP. | ||
network.alibabacloud.com/eip-name | The name of the EIP. For more information, see Apply for an EIP. | ||
network.alibabacloud.com/eip-description | The description of the EIP. For more information, see Apply for an EIP. | ||
network.alibabacloud.com/eip-security-protection-types | The security services used to protect the EIP. Separate multiple security services with a comma | ||
network.alibabacloud.com/pod-eip-release-strategy | "Never" | The release policy for the pod's EIP. Valid values:
|
Image
Feature | Parameter | Example value | Description |
registry.alibabacloud.com/plain-http-registry | "harbor***.pre.com,192.168.XX.XX:5000,reg***.test.com:80" | When you pull an image from a self-managed image repository that uses the HTTP protocol, configure this parameter to prevent image pull failures caused by different protocols. | |
registry.alibabacloud.com/insecure-registry | "harbor***.pre.com,192.168.XX.XX:5000,reg***.test.com:80" | When you pull an image from a self-managed image repository that uses a self-signed certificate, configure this parameter to skip certificate authentication. This prevents image pull failures caused by certificate authentication failures. |
Scheduling
Feature | Parameter | Example value | Description |
Pod computing power quality retry policy | alpha.alibabacloud.com/compute-qos-strategy | "best-effort-to-default" | Specifies the compute-qos retry policy. The valid value is Important You do not need to specify the |
Operating system
Feature | Parameter | Example value | Description |
Modify Transparent Enormous Pages for the pod's operating system Only GPU and GPU-HPN compute classes are supported. | alibabacloud.com/os-kernel-config | {"transparentHugepageEnabled": "madvise","transparentHugepageShmemEnabled": "advise"} |
|
Annotations automatically added by ACS
The following annotations contain information generated by ACS, such as the allocation results for elastic network interfaces (ENIs) and EIPs. You cannot set or modify these annotations.
Feature | Parameter | Example value | Description |
ENI allocation information | network.alibabacloud.com/allocated-eni-id | "eni-esdxs***" | The ID of the allocated elastic network interface (ENI). |
network.alibabacloud.com/vpc-id | "vpc-sljwo***" | The ID of the VPC to which the ENI belongs. | |
network.alibabacloud.com/vswitch-id | "vsw-lskdw***" | The ID of the vSwitch to which the ENI belongs. If you specified multiple vSwitches when you created the ACS pod, the vSwitch that was ultimately used is displayed here. | |
EIP allocation information | network.alibabacloud.com/allocated-eip-id | "eip-bp1m***" | The ID of the allocated EIP. |
network.alibabacloud.com/allocated-eip-address | "116.62.***" | The IP address of the allocated EIP. | |
Resource specifications | alibabacloud.com/pod-use-spec | "2.5-5Gi" | The CPU and memory specifications of the ACS pod after normalization. The format is "xxvCPU-xxGiB". |
alibabacloud.com/pod-gpu-use-spec | "1" | The number of GPU cards in the ACS pod after normalization. | |
alibabacloud.com/pod-ephemeral-storage | "30Gi" | The size of the temporary storage space of the ACS pod after normalization, in GiB. | |
Scheduling result information | topology.kubernetes.io/region | "cn-hangzhou" | The region where the ACS pod resides. |
topology.kubernetes.io/zone | "cn-hangzhou-i" | The zone where the ACS pod resides. | |
Other metadata | alibabacloud.com/instance-id | "acs-sdsf***" | The instance ID of the ACS pod. |
alibabacloud.com/request-id | "6925D4B7-***" | The request ID. |