All Products
Search
Document Center

Container Service for Kubernetes:Work with the cost insights feature

Last Updated:Apr 17, 2025

The cost insights feature of Container Service for Kubernetes (ACK) provides dashboards that display visualized information about the costs of your clusters, namespaces, node pools, and applications.

Requirement

The cost insights feature is enabled. For more information, see Enable the cost insights feature.

Note

After you enable the cost insights feature, the bill data is automatically displayed at 08:00 the next day. You can select a time range from the drop-down list in the upper-right corner to view the cost data of the cluster within the specified time range.

Procedure

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

  2. On the Clusters page, click the name of the cluster that you want to manage. In the left-side navigation pane, choose Cost Management Suite > Cost Insights.

  3. On the Cost Insights page, click different tabs to view the cost visualization dashboards.

Cluster cost analysis

Filter options

image.png

Feature

Ordinal number

Description

Cluster cost analysis options

The cluster cost analysis options.

  • Actual Bill Amount After Discount (default): To view the payment amount of the cloud resources in the cluster, select this option.

  • Original Bill Amount: To view the original price of the cloud resources in the cluster, select this option.

For more information, see Bill details.
Note

The costs of applications in the cluster can be analyzed by namespace or pod. The application cost is calculated based on the bill amount of the resources.

Cost allocation models

The cost allocation models include single-resource models and weighted multi-resource models. For more information, see Cost estimation strategies.

  • CPU Model: This model is selected by default. Estimate the cost of a pod based on the amount of CPU resources requested by the pod.

  • Memory Model: Estimate the cost of a pod based on the amount of memory resources requested by the pod.

  • CPU-Memory Hybrid Model (recommended Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. The system-recommended weights are used.

  • CPU-Memory Hybrid Model (custom Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. To use this model, you must first select CPU-Memory Hybrid Model (custom Weights) and then edit CPU Weight Settings.

Time range

The time range of the dashboard. The default value is Last 7 Days. You can specify a time range to view the changes in costs and resources within the specified time period.

Cluster cost overview

image

Feature

Ordinal number

Description

View the cost allocation model

The data is related to the selected Cost Allocation Model. By default, the CPU Model is selected. This model estimates the cost of a pod based on the amount of CPU resources requested by the pod.

The cost of the previous day, the cumulative cost of the week, and the cumulative cost of the month.

The cost of the previous day, the day-on-day ratio, the cumulative cost of the week, and the cumulative cost of the month are all calculated based on the bill amount of the cloud resources in the cluster.

The weekly cumulative cost is calculated based on the bill amount of every calendar week and the monthly cumulative cost is calculated based on the bill amount of every calendar month. Bills are generated one day after the transaction date. Therefore, the cumulative cost of the week is zero on Monday of each week and the cumulative cost of the month is zero on the first day of each month.

The day-over-day growth rate compares the cluster cost of the previous day and the cluster cost of the day before the previous day. A green value indicates a decrease and a red value indicates an increase.

Brief information about the cluster cost and resource waste.

The charts display changes in the cluster cost and cluster capacity. The yellow curve indicates the cluster cost and the blue curve indicates the actual cluster capacity. In most cases, the two curves are correlated with each other.

If the two curves represent different trends, it indicates changes in the average cost of individual CPU cores. In this case, you can check whether resources of higher prices are consumed.

Display the real-time estimated costs of namespaces and allocated cost of each namespace

④⑤

Section (4) displays the real-time estimated cost of each namespace in the cluster. The cost of a namespace is the sum of costs of all pods in the namespace. Section (5) displays the allocated cost of each namespace, which is the cluster cost allocated to each namespace based on the specified cost ratio.

Note
  • The costs of namespaces are calculated based on the bill amount.

  • Pods that do not have CPU resource requests configured are not included in the namespace cost calculation.

The specifications and billing methods of nodes in a cluster may vary. When you allocate costs by namespace, you must consider not only the resource requests of each namespace but also the nodes that host the pods in the namespace.

The cost insights feature converts the real-time cost of each node. When the feature calculates the cost of a namespace, it uses the following formula: Σ (Pod resource request/Node capacity) × Node unit price. 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 bill amount. You can allocate costs by multiplying the cluster cost by the cost ratio of each namespace.

Stability and efficiency analysis

image

Feature

Ordinal number

Description

Display the total resource usage of the cluster

The number of pods of each Quality of Service (QoS) class and the total resource usage in the cluster.

Display the pod resource usage in the cluster

The basic information and resource utilization (Usage/Request) of all pods in the cluster. You can filter and sort the pods. This feature allows you to view the workloads with the highest or lowest resource usage in the cluster.

Display the resource configurations of burstable pods in a cluster

The resource configurations of burstable pods in the cluster. You can filter and sort the pods. This feature allows you to view the CPU and memory resource requests and limits of each burstable pod. This helps you understand the cluster resources consumed by the pods and identify potential resource bottlenecks.

Display the resource usage of BestEffort pods in a cluster

The resource configurations of BestEffort pods in the cluster. These pods may have stability issues. You can filter and sort the pods to check whether unexpected BestEffort pods exist in the cluster to avoid risks.

For more information about the Stability & Efficiency Analysis feature, see Use the cost insights feature to identify cluster resource risks.

Cluster cost analysis

image

Feature

Ordinal number

Description

Display changes in the cloud resource cost and the cost ratios of different cloud resources

①②

Section (3) displays the cost ratios of different cloud resources in the cluster. Section (4) displays changes in the cloud resource cost.

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. You can view the costs of different cloud resources to make cost-related decisions.

Display changes in the total cluster cost

Display daily changes in the total cluster cost.

Display the costs of node pools

The bill amount of each node pool or virtual node in the cluster.

Display the trends in real-time estimated costs of namespaces

The specifications and billing methods of nodes in a cluster may vary. When you allocate costs by namespace, you must consider not only the resource requests of each namespace but also the nodes that host the pods in the namespace.

The cost insights feature converts the real-time cost of each node. When the feature calculates the cost of a namespace, it uses the following formula: Σ (Pod resource request/Node capacity) × Node unit price. 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 bill amount. You can allocate costs by multiplying the cluster cost by the cost ratio of each namespace.

Display changes in the resource request and resource utilization of the cluster

Scenarios:

  • Analyze whether resources are wasted in the cluster.

  • When your businesses periodically fluctuate, you can reference the changes of resource watermarks in the histogram chart to resize resources in the cluster.

Histogram chart:

  • Y-axis: the total resource capacity of the cluster, which is the total amount of resources that can be allocated to applications in the cluster.

  • Green column: indicates the requested resources within the current hour.

  • Yellow column: indicates the actual resource usage of the processes in the pods within the current hour.

Allocated but unused resources = Green column - Yellow column

Unallocated resources = Y-axis - Green column

Analysis procedure:

  • Unallocated resource waste: You can reference the amount of unallocated resources to identify resource waste in the cluster. You can modify the resource requests of pods or downgrade the instances that host the pods. We recommend that you keep about 20% of the cluster resources unallocated.

  • Allocated but unused resource waste: You can reference the amount of allocated but unused resources and the rankings of applications and pods with the most idle resources in the namespace dashboard to identify the applications that request a large amount of resources but use only a small amount of resources. Then, you can reduce the resource requests of these applications.

  • Scale resources: When your businesses periodically fluctuate, you can reference the changes of resource watermarks in the histogram chart to resize resources in the cluster and configure an appropriate scaling policy.

Cluster billing details

⑦⑧

A list of daily bills displayed by cloud resource or instance.

Namespace cost analysis

The namespace dashboard allows you to filter namespaces and view the resource and cost information of each namespace. Namespaces are used to manage resources that belong to different departments or teams.

Filter options

image.png

Feature

Ordinal number

Description

Namespace

Select a namespace to analyze. The default value is ALL, which indicates that all namespaces in the cluster are selected.

Cost allocation models

The cost allocation models include single-resource models and weighted multi-resource models. For more information, see Cost estimation strategies.

  • CPU Model (default): Estimate the cost of a pod based on the amount of CPU resources requested by the pod.

  • Memory Model: Estimate the cost of a pod based on the amount of memory resources requested by the pod.

  • CPU-Memory Hybrid Model (recommended Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. The system-recommended weights are used.

  • CPU-Memory Hybrid Model (custom Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. To use this model, you must first select CPU-Memory Hybrid Model (custom Weights) and then edit CPU Weight Settings.

Namespace cost analysis options

The cluster cost analysis options.

  • Actual Bill Amount After Discount (default): To view the payment amount of the cloud resources in the cluster, select this option.

  • Original Bill Amount: To view the original price of the cloud resources in the cluster, select this option.

For more information, see Bill details.

Time range

Select a time range for the dashboard. The default value is Last 7 Days. You can view the changes in costs and resources within the specified time period.

Billing overview

image.png

Feature

Ordinal number

Description

Statistics, estimated costs, and allocated costs of resources in namespaces

You can identify resource waste in the namespace based on the CPU and memory metrics. Metrics:

  • CPU resources:

    • CPU Usage: the amount of CPU resources that are used by the namespace.

    • CPU Request: the amount of CPU resources that are allocated to the namespace.

    • CPU Capacity: the total amount of CPU resources in the cluster.

    • CPU Utilization: the ratio of CPU resources that are used by the namespace to CPU resources that are allocated to the namespace.

  • Memory resources:

    • Memory Usage: the amount of memory resources that are used by the namespace.

    • Memory Request: the amount of memory resources that are allocated to the namespace.

    • Memory Capacity: the total amount of memory resources in the cluster.

    • Memory Utilization: the ratio of memory resources that are used by the namespace to memory resources that are allocated to the namespace.

  • GPU resources:

    • GPU Memory Usage: the amount of GPU memory resources that are used by the namespace.

    • GPU Memory Allocation: the amount of GPU memory resources that are allocated to the namespace.

    • GPU Memory Capacity: the total amount of GPU memory resources in the cluster.

    • GPU Memory Utilization: the ratio of GPU memory resources that are used by the namespace to GPU memory resources that are allocated to the namespace.

Section (2) displays the cost statistics of the applications in the namespace.

  • Real-time Estimated Cost Of The Namespace: the real-time estimated cost of the namespace, which is the sum of the estimated costs of all pods in the namespace.

  • Allocated Cost Of The Namespace: the allocated cost of the namespace, which is the cluster cost allocated to the namespace based on the specified cost ratio.

Cost details and trends

image.png

Feature

Ordinal number

Description

Unit price of core hours

Display changes in the unit price of core hours of the nodes that host the pods of the application.

Changes in CPU and memory utilization

Display changes in the CPU and memory utilization of the namespace.

Changes in the resource request and usage

The resource allocation trend and resource usage trend. The blue curve indicates the trend of allocated resources and the red curve indicates the trend of resources in use.

A node reserves resources for pods during pod scheduling. The amount of resources occupied by container processes usually differs from the amount of allocated resources. The two curves can help you optimize resource allocation and avoid resource waste.

Changes in costs of applications in the namespace

Display changes in the costs of applications in the namespace.

The total cost is the bill amount of the namespace within the specified time range.

The ratio of the namespace cost to the cluster cost.

image.png

Feature

Ordinal number

Description

Pod ranking by resource requests

Sort pods based on resource requests to help you identify the application that requests the most resources and optimize resource allocation.

Pod ranking by resource utilization

Sort pods based on resource utilization to help you identify the application with the lowest resource utilization and avoid resource waste.

Pod ranking by idle resources

The idle resource ratio of a pod is the ratio of resources that are not used by the pod to the total resources allocated to the pod. The value helps you identify resource waste in the pod.

You can identify the pods with the most idle resources in the namespace to locate the applications that cause resource waste in the namespace. Then, you can analyze the causes of resource waste and design targeted resource optimization policies.

Node pool cost analysis

The node pool dashboard displays the cost of cluster resources to help you analyze the use of node pools and choose a proper billing method.

You can analyze the costs of different node pools and then conduct cost control and governance. For example, GPU-accelerated node pools may belong to multiple departments. Therefore, it is difficult to analyze the cost by namespace. In this scenario, you can allocate cost by node pool and set cost optimization policies for different node pools.

Filter options

image.png

Feature

Ordinal number

Description

Node pool cost analysis options

The cluster cost analysis options include the following options:

  • Actual Bill Amount After Discount: This option is selected by default. To view the payment amount of the cloud resources in the cluster, select this option.

  • Original Bill Amount: To view the original price of the cloud resources in the cluster, select this option.

For more information, see Bill details.

Node pool

Select a node pool to analyze its cost. The default setting is All, which means that all node pools in the cluster are selected.

Time range

Select a time range for the dashboard. The default value is Last 7 Days. You can view the changes in costs and resources within the specified time period.

Billing overview

image.png

Feature

Ordinal number

Description

Node pool cost

The ratio of the cost of the current day to the cost of the previous day. A green value indicates a decrease and a red value indicates an increase.

Unit price of core hours of nodes

Display changes in the unit price of core hours of the nodes in the node pool within a period of time.

Changes in node costs and changes in the node pool cost ratio

③④

Display changes in the costs of the nodes in the node pool, and changes in the ratio of the node pool cost to the total cluster cost.

Billing method and cost estimation

image.png

Feature

Ordinal number

Description

Estimate cost savings based on the billing methods of nodes to help you optimize resource allocation and select a proper billing method.

①②④

Display changes in the ratios of nodes that use different billing methods within a period of time, and changes in the cost ratios of nodes that use different billing methods in the node pool. The following billing methods are supported:

  • PayAsYouGo: pay-as-you-go.

  • PayByPeriod: subscription.

  • Spot: preemptible instance.

③⑥

Estimate cost savings after you change the billing method of nodes to help you optimize resource allocation and select a proper billing method.

Cost and billing method statistics about the nodes in the node pool.

Application cost analysis

The application dashboard allows you to use label wildcards to filter applications and view the cost and resource usage of the desired applications. Application cost analysis focuses on scenario-specific cost optimization. Application cost analysis applies to scenarios such as big data computing, AI computing, and elastic scaling.

Label wildcards allow you to monitor not only the cost and resource usage of a single application but also the cost and resource usage of multiple related applications. For example, in a big data workflow scenario, you can add the same label to all applications in the workflow to analyze the cost of the entire workflow.

Filter options

image.png

Feature

Ordinal number

Description

Node pool cost analysis options

The cluster cost analysis options include the following options:

  • Actual Bill Amount After Discount: This option is selected by default. To view the payment amount of the cloud resources in the cluster, select this option.

  • Original Bill Amount: To view the original price of the cloud resources in the cluster, select this option.

For more information, see Bill details.

Namespace

Select a namespace to analyze its cost. The default setting is All, which means that all namespaces in the cluster are selected.

Filter applications by label

Enter a pod label. You can use = or : to connect the key and value of the label, such as app=ack-cost-exporter or app:ack-cost-exporter.

If the label key contains /, ., or -, you must replace these characters with _ and remove all " characters. For example, you must convert "sparkoperator.k8s.io/submission-id":"db08a66a-c0b7-4d32-8013-02ac4f8eff4c" to sparkoperator_k8s_io_submission_id:db08a66a-c0b7-4d32-8013-02ac4f8eff4c

Cost allocation models

The cost allocation models include single-resource models and weighted multi-resource models. For more information, see Cost estimation strategies.

  • CPU Model: This model is selected by default. Estimate the cost of a pod based on the amount of CPU resources requested by the pod.

  • Memory Model: Estimate the cost of a pod based on the amount of memory resources requested by the pod.

  • CPU-Memory Hybrid Model (recommended Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. The system-recommended weights are used.

  • CPU-Memory Hybrid Model (custom Weights): Estimate the cost of a pod based on the weighted CPU and memory metrics. To use this model, you must first select CPU-Memory Hybrid Model (custom Weights) and then edit CPU Weight Settings.

Time range

Select a time range for the dashboard. The default value is Last 7 Days. You can view the changes in costs and resources within the specified time period.

Billing overview

image.png

image.png

Feature

Ordinal number

Description

Application costs and computing resource utilization

Display the cost of an application in real time and analyze the resource utilization of the application.

  • Application Cost: the cost of the selected application within the specified time range. The cost is calculated based on the bill amount.

  • Current Number Of Replicas Of The Application: the peak and valley values of the number of pods of the application.

  • Computing Resource Utilization: the CPU and memory utilization (Usage / Request).

  • Hourly Cost Of The Nodes: the unit price of core hours of each node that hosts the application.

  • Application Runtime: the runtime of the application.

  • Total Core Hours Consumed: the total number of core hours consumed by the application.

  • Resource Utilization Of The Application In The Cluster/namespace: the ratio of resources used by the application to the total resources in the cluster or namespace.

Pod cost analysis

The resource information and real-time estimated cost of each pod in the application.

Changes in estimated application costs and number of pods

  • Changes In Estimated Application Costs: changes in the hourly cost and unit price of core hours of the application within a period of time.

  • Changes In The Number Of Pods Of The Application: changes in the number of pods of the application.

Changes in CPU, memory, and GPU requests and usage

CPU, memory, and GPU requests and charts:

  • Y-axis: the total resource capacity of the cluster, which is the total amount of resources that can be allocated to applications in the cluster.

  • Blue column: indicates the requested resources within the current hour.

  • Yellow column: indicates the actual resource usage of the processes in the pods within the current hour.

Allocated but unused resources = Blue column - Yellow column

Unallocated resources = Y-axis - Blue column

Analysis procedure:

  • Unallocated resource waste: You can reference the amount of unallocated resources to identify resource waste in the cluster. You can modify the resource requests of pods or downgrade the instances that host the pods. We recommend that you keep about 20% of the cluster resources unallocated.

  • Allocated but unused resource waste: You can reference the amount of allocated but unused resources and the rankings of applications and pods with the most idle resources in the namespace dashboard to identify the applications that request a large amount of resources but use only a small amount of resources. Then, you can reduce the resource requests of these applications.

  • Scale resources: When your businesses periodically fluctuate, you can reference the changes of resource watermarks in the histogram chart to resize resources in the cluster and configure an appropriate scaling policy.

Billing method and pod usage

image.png

Feature

Ordinal number

Description

Estimate cost savings after you change the billing method of nodes

Estimate cost savings or additional costs after you change the billing method of all nodes that host the application to help you optimize resource allocation and select a proper billing method.

Application cost statistics

②③

Display the billing method statistics of the nodes that host the application pods and the hourly cost of the nodes to help you select a proper billing method for the nodes.

Pod ranking by resource requests, resource utilization, and idle resources

The following rankings can help you identify the application with the most idle resources to avoid resource waste:

  • Pod Ranking By Resource Requests: Sort pods based on resource requests to help you identify the application that requests the most resources and optimize resource allocation.

  • Pod Ranking By Resource Utilization: Sort pods based on resource utilization to help you identify the application with the lowest resource utilization and avoid resource waste.

  • Pod Ranking By Idle Resources: The idle resource ratio of a pod is the ratio of resources that are not used by the pod to the total resources allocated to the pod. The value helps you identify resource waste in the pod.

    You can identify the pods with the most idle resources in the namespace to locate the applications that cause resource waste in the namespace. Then, you can analyze the causes of resource waste and design targeted resource optimization policies.

Use the cost insights feature to analyze the costs of IDC nodes and applications in registered clusters

The cost insights feature allows you to analyze the costs of IDC nodes and applications in registered clusters. The default unit price is CNY 0.3/vCore hour. You can customize the unit price of IDC nodes by using the following methods.

  • Set a CPU unit price for all on-premises servers

    Add the DefaultIDCPricePerCPUCoreHour environment variable to the ack-cost-exporter Deployment in the kube-system namespace to specify a CPU unit price for all on-premises servers.

    Note

    The unit of the price is CNY/vCore hour.

    env:
    # Set the CPU unit price to CNY 0.3/vCore hour. 
    - name: DefaultIDCPricePerCPUCoreHour
      value: "0.3"
  • Set a unit price for a node

    Add the "node.kubernetes.io/price-per-day" label to a node to specify a unit price for the node.

    Note

    The unit of the price is CNY/day.

    Run the following command to set the unit price of the node to CNY 100/day.

    kubectl label nodes <node-name> node.kubernetes.io/price-per-day="100"

FAQ

Why is no data displayed after I enable the cost visualization feature?

  • Check whether the RAM role is granted the required permissions. For more information, see Step 3 in the topic about how to enable the cost analysis feature. The cost analysis feature requires the monitoring data and cost data of the cluster. The monitoring data is collected within 3 minutes after you enable the feature. The cost data is displayed at 08:00 the next day after you enable the feature.

  • Check whether a NAT gateway is configured for the cluster. You cannot use the internal endpoint to query bills in certain regions. Make sure that your cluster has Internet access.

  • The day-over-day growth rate and predicted cost of the next day are displayed only after the cost data is collected for two consecutive days.

Why does the sum of namespace costs differ from the actual bill amount?

The costs of namespaces are estimated based on the original price. Therefore, when discounts, vouchers, or the subscription billing method is used, the estimated costs may differ from the bill amount. You can allocate costs by multiplying the cluster cost by the cost ratio of each namespace.

Why is the cost data of some pods on nodes unavailable?

Check whether the RAM role authorization operation is completed, and confirm that the authorization policy includes the "ecs:DescribeDisks" permission. For more information, see Step 3 of enabling the cost analysis feature.

Why does the bill not include all cloud resources used by the cluster?

The cost analysis feature analyzes only the cloud resources that are exclusively used by the cluster. Cloud resources that are shared by multiple clusters are not included in the bill.

The cost insights feature depends on the cost tag feature in the Billing and Cost Management console. The feature tracks and analyzes the costs of a cluster based on a specific tag (key: value=ack.aliyun.com:{{ClusterId}}) in the cloud resource tag. If you disable this tag on the Cost Tags page, the cluster cost analysis feature becomes invalid. To resolve this issue, enable the ack.aliyun.com and ack.alibabacloud.com/nodepool-id tags on the Cost Tags page.

Why is the cumulative cost of the month or week lower than the actual cost?

The cost data of a cluster before you enable the cost insights feature is not analyzed when the cost insights feature calculates the cluster cost.