All Products
Search
Document Center

Elastic Container Instance:Query split bills of elastic container instances based on tags

Last Updated:Dec 05, 2023

You can bind tags to Elastic Container Instance resources such as elastic container instances, image caches, and virtual nodes (VNodes) as needed. Then, you can manage enterprise ledgers based on tags. This topic describes how to query split bills of an enterprise on demand based on tags.

Bind tags to Elastic Container Instance resources

Tags are similar to labels in Kubernetes in terms of features. Tags are used to mark Elastic Container Instance resources that have the same management or business requirements. This facilitates subsequent classification management and filtering operations. The following table describes the Elastic Container Instance resources to which you can bind tags:

Scenario

Resource

References

Bind tags by using the Elastic Container Instance console or calling an API operation

Elastic container instances

Use tags to manage elastic container instances

Image caches

Manage an image cache

VNodes

Connect a self-managed Kubernetes cluster to a VNode

Bind tags by adding annotations in Kubernetes scenarios

Elastic container instances

Bind custom tags to a pod

By default, the elastic container instances that are created by using Container Service for Kubernetes(ACK) have the following tags bound:

  • ManagedBy: the type of the cluster.

  • ClusterId: the cluster ID.

  • NameSpace: the namespace of the cluster.

  • OwnerReferenceKind: the type of the workload that is created in the cluster, such as Deployment and Job.

  • OwnerReferenceName: the name of the workload that is created in the cluster, such as Deployment name and Job name.

  • PodName: the name of the pod.

Query split bills based on tags

  1. Log on to the Elastic Container Instance console.

  2. In the top navigation bar, click Expenses to go to the Billing Management console.

  3. In the left-side navigation pane, choose Manage Split > Cost allocation tags to enable cost allocation tags.

    • The first time you enable cost allocation tags

      1. On the Cost allocation tags page, read the description of tags and click Next.

      2. Select a tag that you want to enable, click ">" to move the tag to the Selected Tags list, and then click Next.

        启用费用标签1

      3. Click Enable.

    • You previously enabled cost allocation tags

      • To enable a single tag, perform the following operations: In the tag list, find the tag that you want to enable and click Enable in the Operations column corresponding to the tag.

      • To enable multiple tags at a time, perform the following operations: In the tag list, select multiple tags that you want to enable and click Batch Enable at the bottom of the page.

        启用费用标签

    Note

    Tags are case-sensitive. If many tags are displayed in the list, you can search for tags by key.

  4. In the left-side navigation pane, choose Manage Split > Cost Center. Then, you can allocate resources to cost centers by tag.

    1. Add a cost center.

      1. In the left-side navigation pane of the Cost Centers page, click the "+" icon next to Cost Center.

        新增财务单元

      2. In the Add Cost Center dialog box, enter a name for the cost center and click OK.

    2. Allocate resources to the cost center.

      1. In the left-side navigation pane of the Cost Centers page, click All Resources.

      2. In the Tag column of the resource list on the right, click the filter icon. In the dialog box that appears, select the tags that you enabled and click OK.

        财务单元筛选标签

      3. Select Elastic Container Instance resources from the filter results and click Allocate. In the Allocate dialog box, select the cost center that you added and click OK.

        分配财务单元

  5. In the left-side navigation pane, choose Manage Split > Split Bill. On the Split Bill page, filter and view split bills by cost center.

    Note

    The first time you use the split bill feature, follow the on-screen instructions to enable the feature.

    财务单元筛选.png

  6. In the left-side navigation pane, choose Cost Management > Cost Analysis. In the Filters section of the Cost Analysis page, filter costs by cost center and tag to view cost analysis.

    Note

    The first time you use the cost analysis feature, follow the on-screen instructions to enable the feature.

    On the Cost Analysis page, the display mode of charts varies based on the value of Category. The filters that you select from the Filters section on the right filter the data that you want to view. For example, you can select Instance Tag from the Category drop-down list, and select the tags that you want to view in the Filters section. This way, you can view the cost details of the resources that have the tags bound.

    成本分析-intl.png