Cost Insights feature overview

Updated at:

You can use the Cost Insights feature of Container Service for Kubernetes (ACK) to view cost dashboards for dimensions such as cluster, namespace, node pool, and application.

Prerequisites

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

Usage notes

After you enable the Cost Insights feature, bill data is automatically displayed at 08:00 the next day. Select the drop-down list in the upper-right corner to view cluster cost data for different time ranges.

Procedure

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

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, click Cost Suite > Cost Insights.

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

Cost analysis by cluster

Filter criteria

image.png

Feature

Number

Description

Cost statistics options for clusters

①

Options for cluster cost statistics.

  • Actual Billing cost with discount (default): When calculating costs, counts the amount payable for all cloud resources in the cluster.

  • Original Billing cost without discount: When calculating costs, counts the list price of all cloud resources in the cluster.

For more information, see Bill details.
Note

Cost statistics for the application portion of the cluster, including cost statistics for application dimensions such as namespace and Pod, are calculated only by Original Billing cost without discount.

Cost allocation model options

②

Cost allocation model options include the single-resource model and the weighted hybrid-resource model. For more information, see Cost estimation policies.

  • CPU model: The default dashboard option. Uses CPU resource requests to estimate Pod costs.

  • Memory model: Uses memory resource requests to estimate Pod costs.

  • CPU-Memory Hybrid Model (recommended weights): Uses weighted CPU and memory metrics to estimate Pod costs with system-recommended weights.

  • CPU-Memory Hybrid Model (custom weights): Uses weighted CPU and memory metrics to estimate Pod costs. To use this allocation model, first set the cost allocation model to CPU-Memory Hybrid Model (custom weights), and then edit CPU Weight Setting.

Time range

③

The time range of the dashboard. The default is the last 7 days. You can set this option to view cost and resource trends for different time ranges.

Cluster cost overview

image

Feature

Number

Description

View the cost allocation model

①

This result depends on the cost allocation model option that you select. By default, the dashboard uses the CPU model option, which uses CPU resource requests to estimate Pod costs.

Analyze the cluster cost summary through yesterday, this week, and this month

②

Cost statistics. Yesterday's cluster spending, the day-on-day cost ratio, cumulative spending this week, and cumulative spending this month are bill cost statistics for the cloud resources in this cluster.

Cumulative spending this week and cumulative spending this month are bill spending statistics for the calendar week and the calendar month, respectively. Because the billing cycle has a T+1 delay, cumulative spending this week is not displayed on Mondays, and cumulative spending this month is not displayed on the first day of each month.

The day-on-day cost ratio compares yesterday's cluster cost with the cost of the previous day. Green indicates a decrease, and red indicates an increase.

Use cost trends to assess cluster cost and resource waste

③

A trend chart of cluster spending and cluster capacity. The yellow curve indicates cost consumption, and the blue curve indicates the actual cluster capacity. In most cases, the two curves are correlated to some extent.

Compare the correlation between the two curves. If the two trends are inconsistent, the cost per core in the cluster is abnormal. Check whether any resource is incurring excessive costs.

View real-time cost estimation and cost allocation by namespace

④⑤

④ is the real-time estimated cost of each namespace in the cluster. The cost of a namespace is the sum of the estimated costs of all Pods in the namespace. ⑤ is the cost allocation value of each namespace, which is the share of the actual cluster cost allocated to the namespace based on the estimated proportion.

Note
  • The cost statistics of a namespace are calculated by Original Billing cost without discount.

  • Pods that do not have a Resource Request (CPU) configured are not included in the namespace cost statistics.

Nodes in a cluster may have different instance types and billing methods. When you allocate costs by namespace, you cannot rely only on the resource requests of each namespace. You must also consider the nodes on which the Pods in the namespace run.

Cost Insights converts the real-time cost of each node. When calculating costs by namespace, the cost is converted to Σ(Pod resource requests/node capacity)*node unit price. This method accurately estimates the cost of a namespace.

User discounts, voucher deductions, Subscription billing, and other delayed billing methods can cause the cost of a namespace to differ from the actual bill cost of the cluster. You can allocate costs by multiplying the cost proportion of the namespace by the total cost of the cluster.

Stability & efficiency analysis

image

Feature

Number

Description

View total cluster resource usage

①

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

View cluster Pod resource utilization

②

The basic information and resource utilization (Usage/Request) of all Pods in the cluster. You can filter and sort the list. Use this feature to view, in bulk, the workloads with the highest or lowest resource watermark in the cluster.

View the resource configurations of Burstable Pods in the cluster

③

The resource configurations of Pods whose QoS Class is Burstable. You can filter and sort the list. Use this feature to view the requests (Request) and limits (Limit) of resources such as CPU and memory for each Burstable Pod. This helps you understand the cluster resources that each Pod consumes and identify potential resource bottlenecks.

View the resource usage of BestEffort Pods in the cluster

④

The resource configurations of Pods whose QoS Class is BestEffort. These Pods generally carry a higher stability risk. You can filter and sort the list to check for unexpected BestEffort Pods and avoid the risk.

For more information about the Stability & efficiency analysis feature, see Use cost insights to identify risks for cluster workloads.

Cluster cost analysis

image

Feature

Number

Description

Analyze cloud product costs through cloud product cost trends and ratios

①②

③ shows the proportion of cost spending for each cloud product in the cluster, and ④ shows the cost spending trend of each cloud product in the cluster.

A cluster can contain multiple cloud products. Different cloud products are used and billed differently, so the costs that they incur vary. You can view the spending on different cloud products by cost trend and composition to make cost decisions.

Analyze cluster costs through total cluster cost trends

③

The daily trend of the total cost of the cluster.

Analyze cluster costs through node pool cost trends

④

An analysis of the bill cost of the nodes in each node pool or virtual node in the cluster.

View real-time cost estimation trends by namespace

⑤

Nodes in a cluster may have different instance types and billing methods. When you allocate costs by namespace, you cannot rely only on the resource requests of each namespace. You must also consider the nodes on which the Pods in the namespace run.

Cost Insights converts the real-time cost of each node. When calculating costs by namespace, the cost is converted to Σ(Pod resource requests/node capacity)*node unit price. This method accurately estimates the cost of a namespace.

User discounts, voucher deductions, Subscription billing, and other delayed billing methods can cause the cost of a namespace to differ from the actual bill cost of the cluster. You can allocate costs by multiplying the cost proportion of the namespace by the total cost of the cluster.

Cluster compute resource request and utilization trends

⑥

Use cases:

  • Analyze cluster resource watermarks and capacity to determine whether resource waste exists.

  • In elastic scaling and similar scenarios, cluster watermarks can fluctuate periodically and help you plan resource capacity.

Trend chart details:

  • Y-axis: The total compute resource capacity (Capacity) of the entire cluster, which represents the amount of application resources that the cluster can host.

  • Green bars: The total compute resources that are allocated (Request) in the cluster during the current hour.

  • Yellow bars: The compute resources that processes in Pod containers actually use (Usage) in the cluster during the current hour, that is, the resources that the applications actually use.

Allocated but unused application resources=Green bars-Yellow bars

Remaining allocatable cluster resources=Y-axis-Green bars

Analysis process:

  • Unallocated resource waste: Refer to the remaining allocatable cluster resources and use the resources in the cluster that are not allocated and are therefore wasted. You can adjust the resource requests (Request) of the Pods in the cluster or lower the specifications as appropriate. We recommend that you keep the remaining allocatable cluster resources at about 20% of the total cluster resources.

  • Allocated but unused resource waste: Refer to the amount of allocated but unused resources in the cluster and the ranking of wasteful applications and Pods on the namespace dashboard. Identify the applications that are allocated excessive resources but actually use only a small amount, and lower their resource allocation (Request).

  • Elastic scaling scenario: In common situations such as periodic fluctuations in your business, you can refer to the fluctuating watermarks in the bar chart to plan resource capacity and configure an appropriate elastic policy.

Cluster billing details

⑦⑧

The daily bill list of the cluster, by cloud product and by cloud product instance.

Cost analysis by namespace

The namespace dashboard lets you filter by namespace and view the resource and cost information of each namespace. A namespace usually corresponds to a department or a team in your company.

Filter criteria

image.png

Feature

Number

Description

Namespace

①

Select the namespace of the cluster that you want to analyze. The default is ALL, which means the entire cluster.

Cost allocation model options

②

Cost allocation model options include the single-resource model and the weighted hybrid-resource model. For more information, see Cost estimation policies.

  • CPU model (default): Uses CPU resource requests to estimate Pod costs

  • Memory model: Uses memory resource requests to estimate Pod costs.

  • CPU-Memory Hybrid Model (recommended weights): Uses weighted CPU and memory metrics to estimate Pod costs with system-recommended weights.

  • CPU-Memory Hybrid Model (custom weights): Uses weighted CPU and memory metrics to estimate Pod costs. To use this allocation model, first set the cost allocation model to CPU-Memory Hybrid Model (custom weights), and then edit CPU Weight Setting.

Cost statistics options for namespaces

③

Options for cluster cost statistics.

  • Actual Billing cost with discount (default): When calculating costs, counts the amount payable for all cloud resources in the cluster.

  • Original Billing cost without discount: When calculating costs, counts the list price of all cloud resources in the cluster.

For more information, see Bill details.

Time range

④

Select the time range of the dashboard. The default is the last 7 days. You can view cost and resource trends for different time ranges.

Billing overview

image.png

Feature

Number

Description

Namespace resource statistics, cost estimation, and cost allocation

①

You can use the CPU and memory metrics to identify resource waste in a namespace. The metrics are described as follows:

  • CPU resources:

    • CPU resource usage: The number of CPU cores that the namespace currently consumes.

    • CPU resource requests: The number of CPU cores that are currently allocated to the namespace.

    • Total CPU resource capacity: The total number of CPU cores in the cluster.

    • CPU resource utilization: The current ratio of CPU usage to CPU requests in the namespace.

  • Memory resources:

    • Memory resource usage: The amount of memory that the namespace currently consumes.

    • Memory resource requests: The amount of memory that is currently allocated to the namespace.

    • Total memory resource capacity: The total amount of memory in the cluster.

    • Memory resource utilization: The current ratio of memory usage to memory requests in the namespace.

  • GPU resources:

    • GPU memory resource usage: The amount of GPU memory that the namespace currently consumes.

    • GPU memory resource allocation: The amount of GPU memory that is currently allocated to the namespace.

    • Total GPU memory resource capacity: The total amount of GPU memory in the cluster.

    • GPU memory resource utilization: The current ratio of GPU memory usage to GPU memory allocation in the namespace.

②

The cost statistics of the applications in the namespace.

  • Namespace real-time cost estimation: The real-time estimated cost of the namespace, which is the sum of the estimated costs of all Pods in the namespace.

  • Namespace cost allocation: The cost allocation value of the namespace, which is the share of the actual cluster cost allocated to the namespace based on the estimated proportion.

Cost details and trends

image.png

Feature

Number

Description

Unit price per core hour

①

The trend of the CPU unit price per core hour of the node on which the Pod runs.

CPU and memory resource utilization trends

②

The trend of CPU and memory resource utilization in the namespace.

Resource request and usage trends

③

The trends of resource allocation and actual resource consumption. The blue curve indicates the allocated resources, and the red curve indicates the resources that are actually consumed.

When a Pod is scheduled, the node pre-allocates a certain amount of resources to the Pod. However, the resources that container processes actually consume usually differ from the pre-allocated resources. ③ reflects the relationship between the two, so that you can optimize wasted resources.

Namespace application cost trends

④

The trend of application costs in the namespace.

The total cost is the cost of the namespace within the selected time range, calculated by Original Billing cost without discount.

The percentage of the namespace spending in the total cluster spending, which indicates the share of the total cluster cost that the selected namespace accounts for.

image.png

Feature

Number

Description

Pod ranking by resource requests

①

Analyzes the applications whose Pods request the largest amount of resources in the cluster, for use cases such as capacity planning.

Pod ranking by resource utilization

②

Shows the application Pod replicas with low resource utilization, which helps you identify idle applications.

Pod ranking by idle resources

③

The idle resource ratio is the proportion of allocated compute resources that a Pod does not use. This ratio reflects the resource waste of the Pod.

By analyzing the Pods that waste the most resources in a namespace, you can identify the main applications that cause the resource waste in the namespace. You can then analyze the causes and design targeted resource optimization strategies.

Cost analysis by node pool

The node pool dashboard provides Cost Insights from the cluster resource dimension, and helps you analyze node pool resource usage and select billing methods.

The node pool dimension focuses on resources and lets you plan and govern resource costs from the perspective of different node pools. For example, resources in a GPU node pool may belong to multiple departments, which makes it difficult to analyze costs from the namespace dimension. With node pools, you can set policies directly at the resource level to optimize costs.

Filter criteria

image.png

Feature

Number

Description

Cost statistics options for node pools

①

Options for cluster cost statistics, including Actual Billing cost with discount and Original Billing cost without discount:

  • Actual Billing cost with discount: The default dashboard option. When calculating costs, counts the amount payable for all cloud resources in the cluster.

  • Original Billing cost without discount: When calculating costs, counts the list price of all cloud resources in the cluster.

For more information, see Bill details.

Node pool

②

Select the node pool of the cluster that you want to analyze. The default is All, which means all node pools.

Time range

③

Select the time range of the dashboard. The default is the last 7 days. You can view cost and resource trends for different time ranges.

Billing overview

image.png

Feature

Number

Description

Node pool cost

①

The rate of change compared with the cost of the previous day. Green indicates a decrease, and red indicates an increase.

Node unit price per core hour

②

The trend of the unit price per core hour of the nodes in the node pool over a period of time.

Node cost trends and trends in the share of total cluster cost

③④

The trend of the cost of the nodes in the node pool, and the trend of the share that the nodes of this node pool account for in the total cluster cost.

Billing methods and cost estimation

image.png

Feature

Number

Description

Predict cost savings by billing method to help optimize the resource mix and billing methods.

①②④

Analyzes the proportion and trend of node counts by billing method over a period of time. It also analyzes the proportion and trend of the cost of the nodes in the node pool by billing method. The following billing methods are supported:

  • PayAsYouGo: Pay-As-You-Go.

  • PayByPeriod: Subscription.

  • Spot: spot instance.

③⑥

The predicted cost savings after you change the billing methods of nodes. It analyzes the cost that can be saved or the additional cost that would be incurred, and helps you optimize the resource mix and billing methods.

⑤

Statistics on the costs and billing methods of all nodes in the node pool.

Cost analysis by application

The application dashboard uses label wildcard matching to filter the applications that you care about and collect cost and resource statistics. It focuses on cost optimization for specific use cases, which typically include big data workloads, AI workloads, and elastic workloads.

Label wildcard matching lets you monitor the cost and resource usage of a single application, and also monitor multiple related applications. For example, in a big data workflow, you can add the same label to all applications in the workflow to analyze the cost of the entire workflow.

Filter criteria

image.png

Feature

Number

Description

Cost statistics options for node pools

①

Options for cluster cost statistics, including Actual Billing cost with discount and Original Billing cost without discount:

  • Actual Billing cost with discount: The default dashboard option. When calculating costs, counts the amount payable for all cloud resources in the cluster.

  • Original Billing cost without discount: When calculating costs, counts the list price of all cloud resources in the cluster.

For more information, see Bill details.

Namespace

①

Select the namespace of the cluster that you want to analyze. The default is All, which means all namespaces.

Filter by label pair

②

Enter the labels of the application Pods. You can use = or : to connect the key and value of a label. For example, app=ack-cost-exporter or app:ack-cost-exporter.

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

Cost allocation model options

③

Cost allocation models include the single-resource model and the weighted hybrid-resource model. For more information, see Cost estimation policies.

  • CPU model: The default dashboard option. Uses CPU resource requests to estimate Pod costs

  • Memory model: Uses memory resource requests to estimate Pod costs.

  • CPU-Memory Hybrid Model (recommended weights): Uses weighted CPU and memory metrics to estimate Pod costs with system-recommended weights.

  • CPU-Memory Hybrid Model (custom weights): Uses weighted CPU and memory metrics to estimate Pod costs. To use this allocation model, first set the cost allocation model to CPU-Memory Hybrid Model (custom weights), and then edit CPU Weight Setting.

Time range

④

Select the time range of the dashboard. The default is the last 7 days. You can view cost and resource trends for different time ranges.

Billing overview

image.png

image.png

Feature

Number

Description

Application cost and compute resource utilization

①

View application costs in real time and analyze resource utilization.

  • Application cost: The cost of the selected application within the time range queried on the dashboard, calculated by Original Billing cost without discount.

  • Current number of application replicas: The number of Pod replicas at the peak and trough values of the application.

  • Compute resource utilization: The CPU and memory utilization (Usage / Request).

  • Hourly cost of the node: The unit price per core hour of each node where the application runs.

  • Application run time: Calculated based on the run time of the application.

  • Total core hours consumed: The total core hours consumed by the application.

  • Application resource utilization in the entire cluster or namespace: The proportion of resources that the application occupies in the cluster and namespace.

Pod-level application cost analysis

②

The resources and real-time estimated cost of each Pod in the application.

Application estimated cost and Pod scale trends

③

  • Application estimated cost trend: The trend of the hourly cost of the application and the unit price per core hour over a period of time.

  • Application Pod scale trend: The trend of the number of Pod replicas of the application.

CPU, memory, and GPU request and usage trends

④

Details of the CPU, memory, and GPU request and usage trend charts:

  • Y-axis: The total compute resource capacity (Capacity) of the entire cluster, which represents the amount of application resources that the cluster can host.

  • Blue bars: The total compute resources that are allocated (Request) in the cluster during the current hour.

  • Yellow bars: The compute resources that processes in Pod containers actually use (Usage) in the cluster during the current hour, that is, the resources that the applications actually use.

Allocated but unused application resources=Blue bars-Yellow bars

Remaining allocatable cluster resources=Y-axis-Blue bars

Waste analysis process:

  • Unallocated resource waste: Refer to the remaining allocatable cluster resources and use the resources in the cluster that are not allocated and are therefore wasted. You can adjust the resource requests (Request) of the Pods in the cluster or lower the specifications as appropriate. We recommend that you keep the remaining allocatable cluster resources at about 20% of the total cluster resources.

  • Allocated but unused resource waste: Refer to the amount of allocated but unused resources in the cluster and the ranking of wasteful applications and Pods on the namespace dashboard. Identify the applications that are allocated excessive resources but actually use only a small amount, and lower their resource allocation (Request).

  • Elastic scaling scenario: In common situations such as periodic fluctuations in your business, you can refer to the fluctuating watermarks in the bar chart to plan resource capacity and configure an appropriate elastic policy.

Billing methods and Pod usage

image.png

Feature

Number

Description

Cost-savings prediction analysis after changing node billing methods

①

Analyzes the cost that can be saved or the additional cost that would be incurred if all nodes of the current application were changed to different billing methods. This helps you optimize the resource mix and the billing methods.

View cost analysis from an application perspective

②③

Includes statistics on the billing methods of the nodes where the application runs, and statistics on the hourly cost and billing methods of these nodes. Use this to analyze the distribution and trends of the different billing methods of the nodes in the application.

Resource and cost idle rankings for application Pods

④

Analyzes the cost consumption of a department based on costs and expenses to help you identify applications with high idle ratios. The metrics are described as follows:

  • Pod ranking by resource requests: Provides statistics on the applications in the cluster whose Pods request the most resources. This is suitable for use cases such as capacity planning.

  • Pod ranking by resource utilization: Shows the application Pod replicas with low resource utilization to help you identify wasteful applications.

  • Pod ranking by idle resources: The proportion of unused resources to the allocated resources of a Pod, which reflects the resource waste of the Pod.

    Identify the Pods that waste the most resources in a namespace to locate the main applications that cause resource waste in the namespace. Then analyze the causes of the waste and design targeted resource optimization strategies.

Use ACK Cost Insights in a registered cluster to analyze the cost of nodes and applications in the cloud and in on-premises data centers

Cost Insights can analyze the cost of data center nodes in a registered cluster and the applications that run on these nodes. The default unit price is CNY 0.3 per core hour. You can customize the unit price of data center nodes by performing the following steps.

  • Configure a uniform price for all on-premises data center nodes

    In the kube-system namespace, add the DefaultIDCPricePerCPUCoreHour environment variable to the ack-cost-exporter Deployment.

    The price is in CNY/Core*Hour.
    env:
    # Set the price per core hour for each on-premises data center node to CNY 0.3.
    - name: DefaultIDCPricePerCPUCoreHour
      value: "0.3"
  • Configure a separate price for a specific node

    Add the "node.kubernetes.io/price-per-day" label to a specific node.

    The price is the total price per day for this node.

    Set the total daily price for a specific node to 100 CNY:

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

FAQ

Why is no data displayed after I enable cost visualization?

  • Check whether the RAM role authorization is complete. For details about how to enable the cost analysis feature, see step 3. Cost analysis requires the monitoring data and cost data of the cluster. Monitoring data collection starts within 3 minutes after the feature is enabled. Cost data is displayed at 08:00 on the day after you enable cost analysis for the cluster.

  • Check whether a NAT gateway is configured for the cluster. Some regions do not support querying bills through an internal endpoint. Make sure that your cluster can access the Internet.

  • day-on-day cost ratio and next-day estimated cost are displayed only after cost data has been collected for two consecutive days.

Why does the total of the namespace costs not match the actual bill?

The cost of a namespace is derived from cost estimation rather than from direct bill analysis. Cost estimation is calculated based on list prices. Therefore, data deviations may occur when the cost of the cluster includes deduction policies such as vouchers, discounts, and savings plans. You can allocate the bill by multiplying the proportion of each namespace by the total cost of the cluster.

Why is cost data unavailable for the Pods on some nodes?

Verify that the RAM role authorization is complete and that the authorization policy includes the "ecs:DescribeDisks" permission. For details about how to enable the cost analysis feature, see step 3.

Why do the cloud products displayed in the bill not include all the cloud products that the cluster uses?

Cost analysis counts only the cloud products that are exclusively used by this cluster. Cloud products that are shared by multiple clusters are not included in the bill statistics of cost analysis.

The Cost Insights feature depends on the cost allocation tag feature of the Expenses and Costs console. That is, it depends on a specific identifier in cloud product tags (key: value=ack.aliyun.com:{{ClusterId}}) to track cluster costs and generate cost statistics. If you disable this tag on the Cost Allocation Tag page, cluster-level cost statistics are revoked. To resolve this issue, go to the cost allocation tag management page and re-enable the ack.aliyun.com and ack.alibabacloud.com/nodepool-id tags.

Why is cumulative spending for this month or this week lower than the actual amount?

The cluster starts to count incurred costs only after the Cost Insights add-on is successfully enabled. Data generated before the add-on is enabled is not counted.