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.
Obtain the ID of the cluster.
Log on to the ACK console. In the left-side navigation pane, click Clusters.
In the cluster list, copy the cluster ID in the Cluster Name /ID column.
Enable the cluster tag.
Log on to Expenses and Costs.
In the left-side navigation pane, choose
.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.
Create a cost center.
In the left-side navigation pane, choose
.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.
In the Overview section, click the name of the cost center and click Create Rule on the Automatic Allocation Rule tab.
Click the 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.
View the cost of the cluster.
In the left-side navigation pane of the Expenses and Costs console, choose
.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.
NoteA newly created cost center displays only cost data within the previous 24 hours.