This topic introduces the cost analysis feature and describes how to configure cost analysis for a Container Service for Kubernetes (ACK) cluster.
- The Kubernetes version of your ACK cluster is 1.18.8 or later. If the Kubernetes version is earlier than 1.18.8, update to 1.18.8 or later. For more information, see Update the Kubernetes version of an ACK cluster.
- Application Real-Time Monitoring Service (ARMS) Prometheus is enabled for your cluster. For more information, see Enable ARMS Prometheus.
- The cost analysis feature is enabled for your cluster. For more information, see Enable and disable cost analysis.
View cost analysis results
- Log on to the ACK console and click Clusters in the left-side navigation pane.
- On the Clusters page, click the name of a cluster and choose in the left-side navigation pane.
- On the Cost Analysis page, click the Cluster tab to view the cluster dashboard that displays the cost analysis results. Note
- After cost analysis is enabled, bills are displayed at 08:00:00 (UTC+8) on the next day.
- You can click the drop-down list in the upper-right corner of the Cluster tab to change the time range.
Cluster cost analysis
The following table describes the features of the cluster dashboard.
|Display the cost trend to help you identify resource waste in the cluster||①||This feature displays information about the cost of a cluster. The Daily Cost metric displays the cost of the previous day. The Weekly Cost metric displays the cost of the previous week. The Monthly Cost metric displays the cost of the previous month. The Day-on-day Ratio metric displays the growth rate of the cost of the previous day. |
|②||The yellow curve indicates the resource consumption of the cluster. The blue curve indicates the actual resource capacity of the cluster. In most cases, the two curves are correlated with each other. |
If the two curves represent different trends, it indicates changes to the average cost of individual CPU cores. In this case, you can check whether resources of higher prices are consumed.
|③||The cost trend within a time period.|
|Display the costs of different namespaces||④|
A cluster may contain nodes of different specifications and billing methods. When you allocate the cost based on namespaces, you must consider the price differences of nodes that host pods in different namespaces, not only the resource consumption of different namespaces.
The cost analysis feature converts the real-time cost of each node and provides the following formula to calculate the cost of a namespace:
The formula can help you precisely calculate the cost of a namespace. However, due to the deferred billing policy applied when discounts, vouchers, or the subscription billing method is used, the cost calculated based on this formula may differ from the amount on the bill. To calculate the actual cost of a namespace, you can multiply the amount on the cluster bill by the cost ratio of the namespace.
|Display the cost trends of cloud resources||⑤||A cluster may use multiple cloud resources. The costs of cloud resources vary based on billing rules and how the cloud resources are used by the cluster. This feature displays the cost trends and contributions of different cloud resources to help you reduce the cost of the cluster.|