Help Center/ Cloud Container Engine_Autopilot/ Best Practices/ Using Resource Tags to Analyze the Costs of CCE Autopilot
Updated on 2026-04-28 GMT+08:00

Using Resource Tags to Analyze the Costs of CCE Autopilot

You can add resource tags to resources in CCE Autopilot clusters, then filter and aggregate the costs of the resources by tag, and analyze costs by cluster to reduce costs and improve efficiency.

Constraints

  • Constraints on cluster tags:
    • Each cluster can have a maximum of 20 tags.
    • When you create clusters v1.28.10, v1.31.10, v1.32.6, or later, CCE automatically adds the CCE-Cluster-ID={cluster-ID} resource tag to each cluster.
  • Constraints on workload or pod tags:
    • Tags can only be added to workloads or pods in clusters v1.28.10, v1.31.10, v1.32.6, and later.
    • Resource tags CCE-Cluster-ID={cluster-ID} and CCE-Namespace={namespace-name} added by CCE to pods cannot be deleted.
    • You can add up to 15 custom tags to the pods of each workload.
    • You cannot change the tags that have been added to pods.
    • If the CCE-Cluster-ID or CCE-Namespace tag is configured incorrectly (for example, the value of CCE-Cluster-ID is not the ID of the cluster where the workload is running, or the value of CCE-Namespace is not the namespace where the workload is running), the creation request will be intercepted.
  • Generally, tags are displayed on the Cost Tags page 24 hours after resource expenditures are generated.
  • You can filter or group cost data by tag only after the tags are activated. If you activate the tags, they will be used to organize your resource costs generated thereafter.

Procedure

  1. Add resource tags to resources in a CCE Autopilot cluster.

    Table 1 Resources in a CCE Autopilot cluster and resource tag configuration methods

    Function

    Cloud Service

    Resource Tag Configuration Method

    Cluster

    CCE

    In clusters v1.28.10, v1.31.10, v1.32.6, and later, the resource tag CCE-Cluster-ID is added by default. You can configure custom resource tags on the CCE console. For details, see 1.a.

    Workload

    CCE

    For workloads created in clusters v1.28.10, v1.31.10, v1.32.6, and later, the resource tags CCE-Cluster-ID and CCE-Namespace are added to pods by default. You can configure custom pod resource tags on the CCE console. For details, see 1.b.

    SNAT for containers to access the public network

    NAT Gateway (public NAT gateway)

    Add resource tags to the public NAT gateway on the NAT Gateway console.

    APM Agent

    VPC Endpoint

    Add resource tags on the VPC Endpoint console.

    VPC endpoint (image access)

    VPC Endpoint

    For clusters earlier than v1.28.10, v1.31.10, and v1.32.6, automatically-created VPC endpoints for accessing SWR and OBS are tagged with CCE-AutopilotCluster-ID by default. This tag is no longer used in clusters of later versions.

    You can add custom resource tags on the VPC Endpoint console.

    Connecting to the cluster API server

    VPC Endpoint

    For clusters v1.28.10, v1.31.10, v1.32.6, or later, new resources are tagged with CCE-Cluster-ID by default.

    You can add custom resource tags on the VPC Endpoint console.

    Accessing the API server over a public network

    EIP

    Add resource tags on the EIP console.

    LoadBalancer Service or ingress

    ELB

    Add resource tags on the ELB console.

    You can also configure resource tags on the CCE console when automatically creating a LoadBalancer Service or ingress. For details, see Creating a LoadBalancer Service and Creating a LoadBalancer Ingress on the Console.

    EVS PV

    EVS

    Resource tags CCE-Cluster-ID, CCE-Cluster-Name, and CCE-Namespace are added by default. You can add custom resource tags on the EVS console.

    You can also configure custom resource tags on the CCE console when dynamically creating EVS PVs. For details, see Using EVS Disks with Dynamic Storage Volumes.

    SFS PV

    SFS

    Add resource tags on the SFS console.

    OBS PV

    OBS

    Add resource tags on the OBS console.

    1. Add custom resource tags to the cluster on the CCE console.
      1. Log in to the CCE console and click the cluster name to access the cluster console.
      2. Add custom resource tags to a cluster when creating or editing the cluster.
        1. In the upper right corner of the Clusters page, click Buy Cluster. In the Resource Tag area under Advanced Settings, click Add to add resource tags to the cluster.

        2. For an existing cluster, view the cluster details on the Overview page. In the More Information area on the right, click Edit in the Resource Tag area to add resource tags to the cluster.

    2. Add custom resource tags to pods on the CCE console.
      1. Log in to the CCE console and click the cluster name to access the cluster console.
      2. You can add custom tags to pods when creating or upgrading a workload.
        1. In the navigation pane, choose Workloads. In the upper right corner, click Create Workload and then enter the basic workload information. In the Advanced Settings area, click Labels and Annotations and add tags under Pod Resource Tag.
        2. For an existing workload, click Upgrade. In the Advanced Settings area, click Labels and Annotations and add tags under Pod Resource Tag.

  2. Activate the resource tags.

    Log in to Cost Center, choose Cost Tags in the navigation pane, select the resource tags to be activated, and click Activate.

    Figure 1 Activating a cost tag

    The information similar to that shown in the figure below will be displayed.

    Figure 2 Activation succeeded

  3. Configure cost analysis.

    You can configure cost analysis by cluster or service.

    • By cluster: Cost Center analyzes costs based on the CCE-Cluster-ID cost tag and service type. You can use this method to summarize the cost data of cloud service resources (configured with the CCE-Cluster-ID resource tag) used by all clusters or a specific cluster.
      1. In the navigation pane of Cost Center, choose Cost Analysis. On the displayed page, click Multi-Dimensional MTD Costs.
      2. In the Display Dimensions area on the right, set two dimensions. Select Cost Tags > CCE-Cluster-ID for the first dimension and Service Type for the second dimension. The cost data of each cloud service resource used by each cluster is displayed in a chart and a list on the left of the page. In the cluster list displayed in the Cost and Usage Details area, click + next to a specific cluster to display the cost data of each cloud service resource (configured with the resource tag CCE-Cluster-ID) used by the cluster.
      3. If you only want to display the cost data of cloud service resources used by a specific cluster, set two dimensions in Grouped By in the Display Dimension area on the right of the page. Select Cost Tags > CCE-Cluster-ID for the first dimension and Service Type for the second dimension. In the Filters area, select CCE-Cluster-ID for Cost Tags. Set the tag value to the ID of the specific cluster. The costs of each cloud service resource used by the cluster are displayed in a graph and a list on the left of the page.
    • By service: You can add custom resource tags to resources used in specific service scenarios. Cost Center analyzes costs by cost tags (custom resource tags configured for the service scenario) and summarizes the costs of resources involved in the service scenario.
      1. In the navigation pane of Cost Center, choose Cost Analysis. On the displayed page, click Start Custom Analysis.
      2. In the Filters area on the right of the displayed page, select the configured and activated resource tag from the drop-down list of Cost Tags. Cost Center then analyzes costs by the selected cost tag. For example, the cce-ap-key001 cost tag is used to identify different service scenarios, and different values of this tag identify costs of different service scenarios.