All Products
Search
Document Center

Container Service for Kubernetes:Cost control

Last Updated:Sep 10, 2024

Cost control is an essential part of FinOps. After you extract insights from cost data and implement cost optimization strategies, you can use cost control to limit the length of the cost governance lifecycle. This helps prevent cost overruns in clusters and applications. This topic describes how to control the costs of clusters, departments, and applications.

Overview

  • Cluster cost control: A tag is added to all Alibaba Cloud resources used in Container Service for Kubernetes (ACK) clusters. The key of the tag is ack.aliyun.com and the value of the tag is the ID of the cluster. You can create a cost center based on this tag in Expenses and Costs to quickly view the cost of a cluster.

  • Department cost control: A department is a collection of applications. In most cases, departments are the smallest units for cost allocation. Department administrators can set budgets and compare them with the actual costs to identify cost overruns and enforce cost control at the earliest opportunity.

  • Application cost control: In most cases, applications are the smallest units for budget setting and management. Application administrators can set cost baselines to trace the trend of application costs. This helps avoid cost overruns in applications.

Procedure

This section describes how to view the cost of a cluster.

  1. Obtain the ID of the cluster.

    1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

    2. In the cluster list, copy the cluster ID in the Cluster Name /ID column.

  2. Enable the cluster tag.

    1. Log on to Expenses and Costs.

    2. In the left-side navigation pane, choose Manage Split > Cost allocation tags.

    3. On the Cost allocation tags page, enter ack.aliyun.com in the Tag Key field and click Search. In the Actions column of ack.aliyun.com, click Enable.

  3. Create a cost center.

    1. In the left-side navigation pane, choose Manage Split > Cost Center.

    2. In the Overview section, click the 财务单元 icon next to Cost Center below Unallocated Resources. In the Add Cost Center dialog box, enter a name, such as test, and click OK.

    3. In the Overview section, click the name of the cost center and click Create Rule on the Automatic Allocation Rule tab.

    4. Click the image icon and set Condition1 to Tag, select ack.aliyun.com as the tag key, and then select the ID of the cluster as the tag value. Use the default settings for other parameters and click Submit.

      条件选项

  4. View the cost of the cluster.

    1. In the left-side navigation pane of the Expenses and Costs console, choose Cost Management > Cost Analysis.

    2. In the Filters section, click Cost Center, select the cost center that you created in Step 3, and then click Apply.

      On the Cost Analysis page, view the monthly cost of the cluster, as shown in the following figure.

      Note

      A newly created cost center displays only cost data within the previous 24 hours.

      集群成本