Cost insights overview

更新时间:
复制 MD 格式

Estimate, allocate, and account for ACK cluster costs by namespace, node pool, and application.

Before you begin

Familiarize yourself with the following terms:

checkCost estimation: Estimates department or application costs by calculating pod costs.

checkCost allocation: Allocates costs by department or application based on aggregated pod costs.

checkCost accounting: Performs enterprise cost accounting with adjustable unit prices.

checkCost dashboard: Displays cost insights data in ACK console dashboards.

checkCall the API to query cost data: Queries cost data through the Kubernetes API for secondary development.

checkCost data model: The underlying model for cost insights calculations.

Why use cost insights

Cloud-native technologies optimize costs through sharing, isolation, and scaling, but introduce challenges beyond traditional capacity planning:

  • How to accurately calculate ACK cluster costs?

  • How to accurately estimate pod costs?

  • How to accurately estimate costs for online applications or offline jobs?

  • How to allocate ACK cluster costs by department using namespaces?

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

Figure 1. Resource utilization across cluster types

image

Cost insights, a key FinOps capability, helps you monitor daily cost trends, analyze cost issues, and evaluate optimization measures.

Use cases

Pod cost estimation

Pod cost estimation is complex because pods are not one-to-one mapped to cloud resources and have shorter lifecycles. ACK estimates pod costs for CPU, memory, and GPU based on real-time cost and monitoring data. See Cost estimation policies.

Cost allocation by department or application

In a typical resource architecture, departments map to namespaces and labels distinguish applications within a department. Department or application costs are estimated by aggregating pod costs across dimensions.

However, aggregated pod costs do not account for reserved instances, savings plans, vouchers, or cloud services such as Managed Service for Prometheus (Prometheus) and Log Service (SLS). For accurate costs, allocate cluster costs to pods by their estimated cost ratio, then aggregate with upper-layer cloud service costs.

Enterprise cost accounting

In enterprise or data center scenarios, resource costs use adjustable unit prices instead of cloud provider prices. For example, an O&M team can resell resources to business teams at adjusted prices to standardize resource requests and facilitate internal cost accounting. See Custom cost allocation policies.

Dashboard dimensions

Cost insights allocates costs based on resource metering and billing data. Enable cost insights to access dashboards across four dimensions: cluster, namespace, node pool, and application. See Cost Insights feature overview.

image

Dimension

Description

Cluster

Displays cluster resources and cost data. Monitor spending trends and troubleshoot unexpected cost changes.

Namespace

Filters resource and cost data by namespace when departments or applications map to separate namespaces.

Node pool

Analyzes node pool resource costs, primarily Elastic Compute Service (ECS) instances, to help O&M engineers choose optimal billing methods.

Application

Focuses on scenario-specific cost optimization. Use label selectors to filter and view application costs, or monitor interdependent applications together.

For example, label all applications in a big data workflow to analyze costs across the entire pipeline.

Integration and extension

Cost data model

The cost data model enables accurate cluster cost estimation and multi-dimensional cost allocation by business unit. See Integration and extensibility.

Call the API to query cost data

The cost insights feature of Container Service for Kubernetes (ACK) tracks cluster resource usage and cost distribution across multiple dimensions. Cost data is reported to and stored in Managed Service for Prometheus. Call HTTP APIs to query this data for cost optimization analysis or to integrate it into your own tooling.

ACK provides the Cost API, Cost V2 API, and Allocation API to query real-time estimated costs or cost allocation data. See Call the API to query cost data.