Updated on 2026-04-28 GMT+08:00

Cost Tag Management

Scenarios

You can configure cost tags to classify and track pod costs.

Tag Naming Rules

  • Each tag consists of a key-value pair. Example:
    pod-tag.cci.io/<tag-key>:tag-value
  • Each pod can have a maximum of 20 tags.
  • A tag key must be unique for each pod, and each tag key can have only one tag value.
  • A tag consists of a tag key and a tag value. Table 1 lists the tag key and value requirements.
    Table 1 Tag naming rules

    Item

    Rules

    Example

    Tag key

    • A tag key can contain a maximum of 63 characters.
    • Only letters (a-z, A-Z), digits (0-9), hyphens (-), underscores (_), and periods (.) are allowed.
    • A tag key must start and end with a letter or digit. It cannot start or end with a hyphen (-), underscore (_), and period (.).

    Organization

    Tag value

    • Only letters (a-z, A-Z), digits (0-9), hyphens (-), underscores (_), and periods (.) are allowed.
    • A tag value must start and end with a letter or digit.
    • A tag value can be an empty string.

    Apache

Procedure

  1. Log in to the management console.
  2. In the upper right corner of the page, hover over the username and click Tag Management.

    Figure 1 Tag Management

  3. Create a predefined tag. In the navigation pane, choose Predefined Tags. Click Create Tag, enter the tag key and value, and click OK.
  4. In the top navigation bar, choose Billing > Cost Center.
  5. In the navigation pane, choose Cost Organization > Cost Tags. On the Cost Tags page, select the tag created in 3, click Activate, and then click OK.
  6. Wait until the tag status changes to Activated.
  7. Add the following fields to the Podtemplate.metadata.labels file when creating a pod in CCI. The following is an example YAML file:

    kind: Deployment
    apiVersion: cci/v2
    metadata:
      name: tag-example
      namespace: bursting-d0089910820250427-2031
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: tag-example
      template:
        metadata:
          labels:
            app: tag-example
            pod-tag.cci.io/newtag: tag-example-1  # pod-tag.cci.io/<custom-tag-key>: custom-tag-value
        spec:
          containers:
            - name: deploy-example
              image: swr.region-id.domain.com/org-name/image-name:tag
              env:
                - name: ENV1
                  value: 'false'
                - name: ENV2
                  value: xxx
              resources:
                limits:
                  cpu: 500m
                  memory: 1Gi
                requests:
                  cpu: 500m
                  memory: 1Gi
          dnsPolicy: Default
          imagePullSecrets:
            - name: imagepull-secret
      strategy:
        type: RollingUpdate
        rollingUpdate:
          maxUnavailable: 0
          maxSurge: 100%

  8. In the top navigation bar, choose Billing > Cost Center. In the navigation pane, choose Overview. In the Current Month Cost Breakdown area, select Cost Tags and then the created tag to view the cost details.

    Figure 2 Current Month Cost Breakdown