Cost Insights

更新时间:
复制 MD 格式

As an IT cost manager, enable the cost insights feature in ACK to gain multi-dimensional insights into cluster resource usage and cost distribution, receive cost-saving recommendations, and improve resource utilization. After you enable this feature, you can view the cost and resource usage of specific clusters, departments, and applications within a specified financial period. This helps you perform cost estimation, cost allocation, and cost accounting for various scenarios.

Prerequisites

You have integrated Container Service for Kubernetes (ACK) with CloudMonitor 2.0.

Why use cost insights

Many enterprises are adopting cloud-native technologies as part of their digital transformation, making IT cost optimization a primary goal. The sharing, isolation, and auto scaling capabilities of cloud-native technologies make it easy to optimize costs. However, managing IT costs in a cloud-native environment is more challenging than traditional capacity planning. Common questions include:

  • How can I accurately calculate the cost of an ACK cluster?

  • How can I more accurately estimate the cost of a pod?

  • How can I more accurately estimate the cost of an online application or a CronJob?

  • How can I allocate ACK cluster management costs by namespace for different departments?

  • How can I visually identify and optimize cost waste in a cluster?

    Figure 1. Resource utilization of different cluster types

    image

    ACK provides the cost insights feature to address these challenges. Cost insights is a critical component of FinOps (Finance + DevOps), a practice for managing and optimizing cloud costs. This feature supports the entire cost governance lifecycle, including daily cost trend monitoring, root cause analysis for cost anomalies, and evaluation of the effectiveness of optimization measures.

Cost insights dashboard dimensions

Dimension

Description

CS Cost Overview

Displays overall resource usage and costs for a cluster, helping you monitor its financial health. Start by checking the cost trend to see if it meets expectations. If the trend is unusual, use the dashboard data to investigate the root cause.

CS Cost Namespace

Filter by namespace to view resource and cost details for a specific department or business unit.

CS Cost Node Pool

Offers a resource-centric view of costs. Because compute resources (primarily ECS) often dominate cluster costs, this dimension helps you analyze node pool usage and select an optimal billing strategy.

CS Cost Application

Focuses on scenario-based cost optimization. Use label selectors to filter specific applications and aggregate their cost and resource statistics. You can monitor individual applications or groups of related applications.

For example, in a big data workflow, you can apply the same label to all applications in the pipeline to analyze the cost of the entire workflow.

Access the feature

  1. Log on to the Cloud Monitor 2.0 console, and select a workspace. In the left navigation pane, choose Application Center > CloudLens > CloudLens for Container.

  2. In the CloudLens for Container navigation bar, choose CloudLens > Cost Insights.

  3. On the visualization dashboard, click the tabs to view the cost dashboards.

    • CS Cost Overview

    • CS Cost Namespace

    • CS Cost Node Pool

    • CS Cost Application

CS cost overview: Cluster cost analysis

Filter dimensions

Parameter

Description

Cluster billable cost

The metric for calculating cluster costs. The available options are:

  • Actual billable cost (after discounts): (Default) Shows the payable amount for all cloud resources in the cluster.

  • List price billable cost: Shows the list price for all cloud resources in the cluster.

For more information about payable amounts and list prices, see Billing details (offline and redirected).

Note

Costs for application-level resources, such as namespaces and Pods, are always calculated based on the list price billable cost.

Cost allocation model

Specifies the model for allocating costs. You can choose a single-resource model or a weighted hybrid model. The following models are available:

  • CPU model: (Default) Estimates Pod costs based on CPU resource requests.

  • Memory model: Estimates Pod costs based on memory resource requests.

  • CPU-memory hybrid model (recommended weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics, using system-recommended weights.

  • CPU-memory hybrid model (custom weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics. To use this model, you must first select CPU-memory hybrid model (custom weights) and then configure the CPU weight settings.

For more information about choosing a cost allocation model, see Cost estimation strategies.

Time range

Select a time range for the dashboard to view cost and resource trends over different periods.

Cluster cost overview

Metric

Description

  • Current CPU weight

  • Current memory weight

Varies based on the selected cost allocation model. By default, the dashboard uses the CPU model, which estimates Pod costs based on CPU resource requests.

  • Yesterday's cluster cost

  • Day-over-day cost change

  • Tomorrow's predicted cost

  • Cumulative cost this week

  • Cumulative cost this month 

  • Predicted total cost this month

Cost statistics for the cluster. Yesterday's cluster cost, day-over-day cost change, cumulative cost this week, and cumulative cost this month represent the billable costs of cloud resources in this cluster.

Cumulative cost this week and Cumulative cost this month show costs for the calendar week and month, respectively. Due to a one-day (T+1) delay in billing data generation, the weekly cumulative cost is not displayed on Mondays, and the monthly cumulative cost is not displayed on the first day of the month.

Day-over-day cost change shows the percentage change in yesterday's cluster cost compared to the day before:

  • A green percentage indicates a cost decrease from the previous day.

  • A red percentage indicates a cost increase from the previous day.

Cluster cost and capacity trend chart

This chart shows trends in cluster cost and capacity. The yellow curve represents cost, and the blue curve represents actual cluster capacity. Typically, the two curves are correlated.

Inconsistent trends between the two curves may indicate an anomaly in the cluster's cost per core. Check for resources with unusually high costs.

  • Real-time cost estimation (by namespace)

  • Cost allocation (by namespace)

  • Real-time cost estimation: The estimated real-time cost for each namespace in the cluster. A namespace's cost is the sum of the estimated costs of all its Pods.

  • Cost allocation: The allocated cost for each namespace. This is the portion of the cluster's actual cost allocated to the namespace based on its estimated cost ratio.

Note
  • Namespace costs are calculated based on the list price billable cost.

  • If a Pod in a namespace lacks a configured CPU resource request, it is considered to have no declared resource requirements and is excluded from the namespace's cost calculation.

  • A cluster can contain nodes of various types, specifications, and billing methods. When you allocate costs by namespace, you cannot rely solely on the resource request value of each namespace. You must also consider the nodes where the Pods are running.

  • Cost Insights calculates the real-time cost of each node and determines the cost for a namespace using the following formula: Σ (Pod resource request / node capacity) × node unit price

  • This method provides an accurate estimation of namespace costs. However, various factors such as user discounts, coupon deductions, and subscriptions can cause a discrepancy between the estimated namespace cost and the cluster's actual bill. To perform namespace-level bill allocation, you can multiply the total cluster cost by each namespace's cost percentage.

Stability and efficiency analysis

Metric

Description

  • Stability/performance risks

  • Cluster CPU usage overview

  • Cluster memory usage overview

Shows the number of Pods for each QoS class in the cluster and their total resource usage.

Cluster Pod resource utilization analysis

Provides basic information and resource utilization (Usage/request) for all Pods in the cluster. You can filter and sort this data to identify workloads with the highest or lowest resource usage.

Burstable Pod - resource usage analysis

View the resource configuration of Burstable Pods. You can filter and sort the list to check the resource request and limit for each Burstable Pod, helping you understand resource consumption and identify potential bottlenecks.

BestEffort Pod - resource usage analysis

View the resource configuration of BestEffort Pods. These Pods generally have higher stability risks. You can filter and sort the list to check for any unexpected BestEffort Pods and address them to mitigate risks.

Note

For more information about the Stability and efficiency analysis feature, see Use Cost Insights to identify cluster resource risks.

Detailed cost analysis

Metric

Description

  • Cloud product cost analysis

  • Actual cost trend (by cloud product) 

A cluster can contain multiple cloud products with different usage patterns and billing models, leading to cost variations. You can analyze cost trends and combinations for different cloud products to make informed spending decisions.

Actual cost trend (by cluster)

A trend of the cluster's total daily cost.

Actual cost trend (by node pool)

An analysis of the billable costs for each node pool or virtual node in the cluster.

Cost estimation analysis (by namespace) - list price billable cost

  • A cluster can contain nodes of various types, specifications, and billing methods. When you allocate costs by namespace, you cannot rely solely on the resource request value of each namespace. You must also consider the nodes where the Pods are running.

  • Cost Insights calculates the real-time cost of each node and determines the cost for a namespace using the following formula: Σ (Pod resource request / node capacity) × node unit price

  • This method provides an accurate estimation of namespace costs. However, various factors such as user discounts, coupon deductions, and subscriptions can cause a discrepancy between the estimated namespace cost and the cluster's actual bill. To perform namespace-level bill allocation, you can multiply the total cluster cost by each namespace's cost percentage.

Cluster computing resource request and utilization trend chart

Use cases:

  • Analyze resource usage levels and capacity to identify waste.

  • Plan resource capacity for scenarios with periodic fluctuations, such as those involving elastic scaling.

Chart description:

  • The y-axis represents the total computing resource capacity of the cluster, indicating the total amount of application resources the cluster can support.

  • The green bars show the total requested computing resources (request) allocated in the cluster for the current hour.

  • The yellow bars show the actual computing resources used by processes in Pod containers (Usage) for the current hour.

Allocated but unused application resources = Green bars - Yellow bars

Remaining allocatable cluster resources = y-axis - Green bars

Analysis workflow:

  • Unallocated resource waste: Refer to the remaining allocatable resources to identify and reclaim wasted capacity. You can adjust the resource requests of Pods or right-size your cluster. Maintain a resource buffer of approximately 20% of the total cluster resources.

  • Allocated but unused resource waste: Refer to the amount of allocated but unused resources. Use the rankings of wasteful applications and Pods on the namespace dashboard to find workloads with high resource allocations but low actual usage. Then, reduce their resource requests.

  • Elastic scaling scenarios: For scenarios with periodic business loads, use the fluctuation patterns in the chart to plan resource capacity and configure appropriate elastic scaling policies.

  • Cluster billing details - by cloud product

  • Cluster billing details - by instance

A list of daily bills for the cluster, broken down by cloud product and by instance.

Namespace cost analysis

Filter and view resource and cost information by namespace, which often corresponds to departments or teams within your organization.

Filter dimensions

Parameter

Description

Namespace

Select the namespace of the cluster to analyze. The default is ALL, which represents the entire cluster.

Cost allocation model

The model for allocating costs. You can choose a single-resource model or a weighted hybrid-resource model. The following models are available:

  • CPU Model: (Default) Estimates Pod costs based on CPU resource requests.

  • Memory Model: Estimates Pod costs based on memory resource requests.

  • CPU-memory Hybrid Model (recommended Weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics, using system-recommended weights.

  • CPU-memory Hybrid Model (custom Weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics. To use this model, you must first select CPU-memory Hybrid Model (custom Weights) and then configure the CPU Weight Settings.

For more information about choosing a cost allocation model, see Cost estimation strategies.

Actual/list price bill

The metric for calculating cluster costs. The available options are:

  • Actual billable cost (after discounts): (Default) Shows the payable amount for all cloud resources in the cluster.

  • List price billable cost: Shows the list price for all cloud resources in the cluster.

For more information about payable amount and list price, see Billing details (offline and redirected).

Time range

Select a time range for the dashboard. The default is the last 7 days.

Cost overview

Metric

Description

  • CPU resource usage

  • Memory resource usage

  • GPU resource usage

These metrics help identify resource waste within a namespace.

  • CPU resources

    • CPU Resource Usage: The number of CPU cores currently consumed by the namespace.

    • CPU Resource Requests: The number of CPU cores currently allocated to the namespace.

    • Total CPU Resource Capacity: The total number of CPU cores in the cluster.

    • CPU Resource Utilization: The ratio of the namespace's CPU resource usage to its requested amount.

  • Memory resources:

    • Memory Resource Usage: The amount of memory currently consumed by the namespace.

    • Memory Resource Requests: The amount of memory currently allocated to the namespace.

    • Total Memory Resource Capacity: The total amount of memory in the cluster.

    • Memory Resource Utilization: The ratio of the namespace's memory usage to its requested amount.

  • GPU resources:

    • GPU Memory Usage: The amount of GPU memory currently consumed by the namespace.

    • GPU Memory Allocation: The amount of GPU memory currently allocated to the namespace.

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

    • GPU Memory Utilization: The ratio of the namespace's GPU memory usage to its allocated amount.

Real-time namespace cost estimation

The sum of the estimated costs for all Pods within the namespace.

Namespace cost allocation

The portion of the cluster's actual cost allocated to the namespace based on its estimated cost ratio.

Cost details and trends

Metric

Description

Unit price per core-hour

Shows the trend of the unit price per core-hour for the nodes that host the Pods.

CPU/memory resource utilization trend

A trend of the CPU and memory resource utilization within the namespace.

  • CPU resource requests/usage trend

  • Memory resource requests/usage trend

  • GPU memory requests/usage trend

Shows the trend of allocated resources versus actual consumption. The blue curve represents allocated resources, and the red curve represents consumed resources.

When a Pod is scheduled, its node pre-allocates resources. However, the resources actually consumed by the container process often differ. Analyzing the gap between allocated and consumed resources helps you optimize resource usage and reduce waste.

  • Namespace estimated cost trend - list price billable cost

  • Trend of namespace cost as a percentage of total cluster cost

  • Shows the trend of application costs within the namespace.

  • The total cost for the namespace is calculated for the selected time range based on the list price billable cost.

  • The percentage of the namespace's cost relative to the total cluster cost.

Pod resource requests ranking

Ranks applications by their Pod resource requests to assist with capacity planning.

Pod resource utilization ranking - sorted by CPU utilization

Identifies Pod replicas with low resource utilization, helping you find idle applications.

Pod idle resource ranking

  • The percentage of a Pod's allocated but unused computing resources. A higher rate indicates greater resource waste.

  • Analyzing the Pods with the most resource waste helps identify the primary sources of that waste, allowing for targeted optimization.

CS Cost Node Pool: Node pool cost analysis

  • Analyze node pool usage and choose an optimal billing strategy with resource-centric cost insights.

  • Plan and govern costs for individual node pools. For example, specialized resources such as GPU node pools might be shared across multiple departments, making namespace-level cost analysis difficult. The node pool view lets you set policies and optimize costs directly at the resource level.

Filter dimensions

Parameter

Description

Cost metric

Sets the metric for cluster cost analysis:

  • Actual bill cost: The default option. Calculates costs based on the payable amount for all cloud resources in the cluster.

  • List price cost: Calculates costs based on the list price for all cloud resources in the cluster.

For more information about payable amount and list price, see Billing details.

NodePoolID

Selects the node pool to analyze. The default is All.

Time range

Selects a time range for the dashboard, with a default of the last 7 days. This allows you to view cost and resource trends over different periods.

Cost overview

Metric

Description

  • Yesterday's node cost

  • Day-over-day change in node cost for the node pool

  • Node cost for the node pool as a percentage of total cluster cost

  • Node price per core-hour - entire cluster

  • A green value indicates a day-over-day cost decrease.

  • A red value indicates a day-over-day cost increase.

Cluster price per core-hour

Displays the price per core-hour trend for nodes in the node pool.

  • Node pool cost trend

  • Trend of node pool cost as a percentage of total cluster cost

Displays the cost trend for nodes in the node pool and their cost as a percentage of the total cluster cost.

Billing strategy and cost estimation

Metric

Description

  • Trend of node instance count by billing strategy

  • Cost trend of node instances by billing strategy - list price

  • Cluster-wide node billing strategy statistics - list price

  • Cluster-wide node instance count statistics by billing strategy

Shows the proportion and trend of node instances and their costs across billing strategies. The supported strategies are:

  • PayAsYouGo: pay-as-you-go

  • PayByPeriod: subscription

  • Spot: spot instance

  • Predicted cost if all nodes are pay-as-you-go

  • Predicted cost if all nodes are subscription

  • Predicted cost if all nodes are spot instances

  • Daily cost estimation for node pool nodes by billing strategy - list price

Analyzes potential cost savings from changing billing strategies by predicting the impact if all nodes used a single billing method. Use this data to optimize your resource mix.

Hourly node cost/billing strategy statistics - list price

Displays hourly cost and billing strategy statistics for all nodes in the node pool.

CS Cost Application: Application cost analysis

  • Filter for specific applications using label wildcard matching to collect cost and resource statistics. Focuses on scenario-based cost optimization for big data, AI, and elastic scaling workloads.

  • Monitor the cost and resource usage of a single application, or aggregate data for multiple related applications. For example, apply a consistent label to all applications in a big data pipeline to analyze the cost of the entire workflow.

Filter dimensions

Parameter

Description

Cost metric

The metric used to calculate cluster costs. Options include:

  • Actual Billable Cost (after Discounts): The default option. Displays the payable amount for all cloud resources in the cluster.

  • List Price Billable Cost Statistics: Displays the list price for all cloud resources in the cluster.

For more information about payable amounts and list prices, see Billing details (offline and redirected).

Namespace

The namespace of the cluster to analyze. The default is All, which includes all namespaces.

Workload type

The type of cluster resource object.

Workload name

The name of the workload, filtered by the selected workload type.

Label pair filter (LabelSelector)

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

If a label key contains special characters such as /, ., or -, you must replace them with _ and remove all quotation marks ("). 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

Specifies the model for allocating costs. You can choose a single-resource model or a weighted hybrid model. The following models are available:

  • CPU model: (Default) Estimates Pod costs based on CPU resource requests.

  • Memory model: Estimates Pod costs based on memory resource requests.

  • CPU-memory hybrid model (recommended weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics, using system-recommended weights.

  • CPU-memory hybrid model (custom weights): Estimates Pod costs based on a weighted combination of CPU and memory metrics. To use this cost allocation model, you must first select CPU-Memory Hybrid Model (Custom Weights) and then edit the CPU Weight Settings.

For more information about choosing a cost allocation model, see Cost estimation strategies.

Time range

The time range for the dashboard. The default is the last 7 days. Setting this parameter allows you to view cost and resource trends over different periods.

Cost overview

Metric

Description

Application cost

The cost of the selected application for the time range specified on the dashboard, calculated using the list price.

Current number of application replicas

The minimum and maximum number of application Pod replicas.

Application resource utilization share of the cluster/namespace

The percentage of cluster or namespace resources consumed by the application.

Hourly cost of hosting node

The unit price per core-hour for each node hosting the application.

Application runtime / Total consumed core-hours

The total core-hours consumed by the application, based on its runtime.

Compute resource utilization

The CPU and memory utilization rate (Usage / Request).

Pod-level business cost analysis

Displays the resource status and real-time estimated cost for each Pod in the application.

Application estimated cost trend

The trend of the application's hourly cost and unit price per core-hour over a period of time.

Application Pod scale trend

A trend showing the number of application Pod replicas over time.

  • CPU request and usage trend

  • Memory request and usage trend

  • GPU memory request and usage trend

The CPU, memory, and GPU request and usage trend charts show the following:

  • The y-axis represents the total compute resource capacity of the cluster (Capacity), which indicates the total amount of resources the cluster can provide for applications.

  • The blue bars show the total requested compute resources (Request) allocated in the cluster for the current hour.

  • The yellow bars show the actual compute resources used by processes in Pod containers (Usage) for the current hour. This is the amount of resources that the application actually uses.

Allocated but unused application resources = Blue bars - Yellow bars

Remaining allocatable cluster resources = y-axis - Blue bars

Waste analysis workflow:

  • Unallocated resource waste is the remaining allocatable resource capacity. To reduce this waste, you can adjust the resource requests (Request) of Pods or right-size your cluster. We recommend maintaining a buffer of remaining allocatable resources at about 20% of the total cluster resources.

  • Allocated but unused resource waste is the difference between requested and used resources. Use the rankings of wasteful applications and Pods on the namespace dashboard to find workloads with high resource allocations but low actual usage, and then reduce their resource requests (Request).

  • Elastic scaling scenarios: For cyclical workloads, the fluctuation patterns in the bar chart can help you plan resource capacity and configure appropriate elastic scaling policies.

Billing strategies and Pod usage

Metric

Description

  • Predicted cost if all nodes are pay-as-you-go

  • Predicted cost if all nodes are subscription

  • Predicted cost if all nodes are Spot

  • Predicted cost if all nodes are pay-as-you-go

  • Predicted cost if all nodes are subscription

  • Predicted cost if all nodes are Spot

Predicts savings or additional costs if all nodes hosting the application used a single billing strategy, helping you optimize your resource mix.

  • Billing strategy statistics for nodes hosting the application

  • Hourly cost and billing strategy statistics for nodes hosting the application

Includes billing strategy statistics and hourly cost statistics for the nodes where the application runs. Use this data to analyze the distribution and trends of different billing strategies for the application's underlying nodes.

  • Pod resource request ranking

  • Pod resource utilization ranking - sorted by CPU utilization

  • Pod idle resource ranking

Analyzes cost consumption to help identify applications with high idle rates. The metrics are as follows:

  • Pod resource request ranking: Shows applications with high Pod resource requests, which is useful for scenarios such as capacity planning.

  • Pod resource utilization ranking: Ranks Pod replicas by resource utilization to help identify wasteful applications.

  • Pod idle resource ranking: The percentage of a Pod's allocated resources that are unused. It reflects the Pod's resource waste.

    Identifying the Pods with the most resource waste in a namespace enables you to pinpoint the main applications causing the waste. This enables you to analyze the root causes and design targeted resource optimization strategies.

FAQ

Why is cost data not displayed?

  • 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.

  • The Day-over-day cost change and Tomorrow's predicted cost metrics appear only after two consecutive days of cost data collection.

Why do namespace costs not match the bill?

Namespace costs are estimates based on list prices and do not account for coupons, discounts, or savings plans. As a result, these estimates may differ from your final bill. To allocate costs, multiply the total cluster cost by the cost percentage of each namespace.

Why are cloud products missing from the bill?

The cost analysis includes only cloud products used exclusively by a single cluster and excludes those shared by multiple clusters.

The Cost Insights feature relies on the cost allocation tag feature in the Expenses and Costs console. It uses a specific tag, ack.aliyun.com:{{ClusterId}}, to track and collect cluster costs. If you disable this tag on the Cost Allocation Tags page, cluster-level cost statistics cannot be generated. To resolve this, go to the Cost Allocation Tags page and re-enable the ack.aliyun.com and ack.alibabacloud.com/nodepool-id tags.

Why is the cumulative cost lower than the actual cost?

Cost data is not backfilled. Cost Insights begins collecting data when you enable it for a cluster. Reports do not include costs incurred before activation.