Updated on 2024-07-05 GMT+08:00

Configuring Labels and Annotations

Pod Annotations

CCE allows you to add annotations to a YAML file to realize some advanced pod functions. The following table describes the annotations you can add.

Table 1 Pod annotations

Annotation

Description

Default Value

kubernetes.io/ingress-bandwidth

Ingress bandwidth of a pod.

For details, see Configuring QoS for a Pod.

-

kubernetes.io/egress-bandwidth

Egress bandwidth of a pod.

For details, see Configuring QoS for a Pod.

-

node.cce.io/node-az-list

A list of AZs for pod affinity.

For details, see Setting AZ Affinity.

-

Pod Labels

When you create a workload on the console, the following labels are added to the pod by default. The value of app is the workload name.

Example YAML:

...
spec:
  selector:
    matchLabels:
      app: nginx
      version: v1
  template:
    metadata:
      labels:
        app: nginx
        version: v1
    spec:
      ...