Home / Platform management / Metering / CostManagement

CostManagement

Achieve cost and resource cost visualization across multiple clusters. Administrators can intuitively understand cost distribution and resource usage in different clusters. Platform costs can be divided according to different business teams, helping each business team understand its cost allocation. This aids platform administrators in understanding the overall cost structure and taking appropriate measures to optimize resource allocation and control costs.

Glossary

Term Explanation
Usage The actual CPU and memory usage of container groups.
Request The expected request amount of CPU and memory for container groups. This is the amount of resources that container groups want the system to reserve for them.
__Idle__ The idle cost of CPU and memory resources not allocated to any workloads.
Allocated The cost of resources allocated to workloads.
Sum In a specified time range, the sum of allocated cost and __Idle__ cost per day or per hour.
__Unmounted__ The cost of storage resources occupied by pre-created, unallocated persistent volumes (PV).
__Total__ The cumulative cost of CPU, memory, and storage resources.
__Other__ A collection of namespaces not associated with any projects.
CPU/Memory/Storage Cost The sum of allocated cost and the corresponding __Idle__ cost for CPU, memory, and storage.

Prerequisites

General Parameters

In Platform or Cluster cost management, only the cost information of clusters that have successfully deployed the Kubecost plugin is included. In Project cost management, only the cost information of all clusters associated with the project and successfully deployed with the Kubecost plugin is included.

Parameter Description Calculation Formula
Total Cost The cumulative cost of CPU, memory, and storage resources in all clusters within a specified time range. Total Cost = CPU Cost + Memory Cost + Storage Cost (excluding disk cost)
  • CPU Cost = The number of CPU cores in all nodes of all clusters that have successfully deployed the Kubecost plugin * CPU hourly unit price * Time.
  • Memory Cost = Memory (in GB) of all nodes in all clusters that have successfully deployed the Kubecost plugin * Memory hourly unit price * Time.
  • Storage Cost = Capacity of all persistent volumes (PVs) in all clusters that have successfully deployed the Kubecost plugin * Storage hourly unit price * Time.
Note: Storage cost is not calculated if persistent volumes (PVs) are not bound to persistent volume claims (PVCs).
CPU Utilization Efficiency The Usage / Request of container group CPU in all clusters within a specified time range. CPU Usage Efficiency = The sum of Usage of all container group CPUs in all clusters that have successfully deployed the Kubecost plugin / The sum of Request of all container group CPUs in all clusters that have successfully deployed the Kubecost plugin.
Memory Utilization Efficiency The Usage / Request of container group memory in all clusters within a specified time range. Memory Usage Efficiency = The sum of Usage of all container group memory in all clusters that have successfully deployed the Kubecost plugin / The sum of Request of all container group memory in all clusters that have successfully deployed the Kubecost plugin.
Cost Effectiveness The cumulative cost of CPU and memory Usage compared to the cumulative cost of allocation in all clusters within a specified time range. Cost Efficiency = ((CPU Usage Efficiency * CPU Allocated Cost) + (Memory Usage Efficiency * Memory Allocated Cost)) / (CPU Allocated Cost + Memory Allocated Cost)
  • CPU Allocated Cost = max(Usage, Request) * CPU hourly unit price * Time.
  • Memory Allocated Cost = max(Usage, Request) * Memory hourly unit price * Time.
Cost Breakdown Splits the total cost in the platform into resources, primarily CPU, memory, and storage. -
Cost Trends Displays the total, __Idle__, and allocated cost information for the selected time range. -

Platform Cost Management

Display platform cost information for a given time range, including only the cost information of clusters that have successfully deployed the Kubecost plugin. If all clusters in the platform have not deployed the Kubecost plugin, all parameters on the page are displayed as - or No data.

Cost Distribution Line Chart and List

Parameter Cluster Dimension Project Dimension Calculation Formula
Cost Distribution Line Chart Displays the cost information of clusters that have successfully deployed the Kubecost plugin in the selected time range.
  • If the selected time range is 7 days, it shows the cost of clusters in the past 7 days with a time granularity of 1 day.
  • If the selected time range is 1 day, it shows the cost of clusters in the past 24 hours with a time granularity of 1 hour.
Note: If the number of clusters that have successfully deployed the Kubecost plugin is more than 5, only the top 5 clusters by cost are displayed. You can click the legend on the right to view the cost usage information of each cluster.
Displays the project cost information that can be statistically calculated in Kubecost in the selected time range.
  • If the selected time range is 7 days, it shows the project cost of the past 7 days with a time granularity of 1 day.
  • If the selected time range is 1 day, it shows the project cost of the past 24 hours with a time granularity of 1 hour.
-
Cost Distribution List Displays __Total__, __Idle__, and all clusters that have deployed or not deployed the Kubecost plugin in the selected time range. The displayed information includes CPU, memory, storage, cost efficiency, and total cost.

Tip: If the cluster has deployed the Kubecost plugin, you can click the corresponding cluster name to enter the cost page of the cluster to view detailed information.
Displays __Total__, __Idle__, __Other__, and project cost information that can be statistically calculated in Kubecost in the selected time range. The displayed information includes: associated clusters, CPU, memory, storage, cost efficiency, and total cost.

Note:
  • Associated clusters only include the cost information of all clusters associated with the project and have successfully deployed the Kubecost plugin. The display format is: Clusters that have successfully deployed the Kubecost plugin for this project / All clusters associated with this project.
  • __Total__, __Idle__, and __Other__ associated clusters are displayed as -.
  • CPU (CPU Allocated Cost) = max(Usage, Request) * CPU hourly unit price * Time.
  • Memory (Memory Allocated Cost) = max(Usage, Request) * Memory hourly unit price * Time.
  • Storage (Storage Allocated Cost) = Capacity of all persistent volumes (PVs) * Storage hourly unit price * Time.

Cluster Cost Management

Cost Distribution Line Chart and List

Parameter Namespace Dimension Project Dimension Calculation Formula
Cost Distribution Line Chart Displays the cost information of namespaces in the current cluster within the selected time range.

Note: If the number of namespaces in the cluster exceeds 5, only the top 5 namespaces by cost are displayed. You can click the legend on the right to view the cost usage information of each namespace.
Displays the project cost information that can be statistically calculated in Kubecost and is associated with the current cluster in the selected time range. -
Cost Distribution List Displays __Total__, __Idle__, __Unmounted__, and all namespaces in this cluster in the selected time range. The displayed information includes CPU, memory, storage, cost efficiency, and total cost.

Tip: You can click the corresponding namespace name to enter Kubecost and view detailed cost information for that namespace.
Displays __Total__, __Idle__, __Other__, and project cost information that can be statistically calculated in Kubecost and is associated with the current cluster. The displayed information includes: associated clusters, CPU, memory, storage, cost efficiency, and total cost.
  • CPU (CPU Allocated Cost) = max(Usage, Request) * CPU hourly unit price * Time.
  • Memory (Memory Allocated Cost) = max(Usage, Request) * Memory hourly unit price * Time.
  • Storage (Storage Allocated Cost) = Capacity of all persistent volumes (PVs) * Storage hourly unit price * Time.

Project Cost Management

Cost Distribution Line Chart and List

Parameter Namespace Dimension Calculation Formula
Cost Distribution Line Chart Displays the cost information of all namespaces under the current project within the selected time range.

Note: If the number of namespaces under the project exceeds 5, only the top 5 namespaces by cost are displayed. You can click the legend on the right to view the cost usage information of each namespace.
-
Cost Distribution List Displays __Total__, __Idle__, and the cost information of all namespaces under the project in the selected time range. The displayed information includes: associated clusters, CPU, memory, storage, cost efficiency, and total cost.

Note:
  • You can click the corresponding namespace name to enter Kubecost and view detailed cost information for that namespace.
  • The associated clusters indicate the clusters to which the namespaces in this project belong. If the clusters associated with this project have not deployed the Kubecost plugin, the namespaces in these clusters will not be displayed.
  • CPU (CPU Allocated Cost) = max(Usage, Request) * CPU hourly unit price * Time.
  • Memory (Memory Allocated Cost) = max(Usage, Request) * Memory hourly unit price * Time.
  • Storage (Storage Allocated Cost) = Capacity of all persistent volumes (PV) * Storage hourly unit price * Time.

Related Operations

Configuring Currency Units in the Platform

  1. In the left navigation, click on Clusters > Resources.

  2. Switch to the global cluster.

  3. Click on Create Resource to add a new YAML configuration file, as shown below.

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: costmanager-currency
      namespace: finops-system
    data:
      rate: '1'
      unit: '¥'

    Field Descriptions:

    Field Description
    metadata.name This field must be specified as costmanager-currency and cannot be modified.
    metadata.namespace This field must be specified as finops-system and cannot be modified.
    data.rate The exchange rate used in the platform. If not specified, it defaults to 1.

    Note: If the currency units in the platform and Kubecost are different, conversion should be based on the real-time exchange rate. For example, if the platform uses CNY and Kubecost uses USD, this field should be filled with the current exchange rate, such as 7.1409.
    data.unit The currency unit used in the platform. Here, ¥ represents CNY, and $ represents USD.
  4. Click Create and reload the page.

Configuring Currency Units in Kubecost

  1. Log in to Kubecost.

  2. Click on the bottom left corner of the page on Settings.

  3. Click on GENERAL > Cloud Cost Settings > the dropdown box in the Currency section, and choose CNY.

    Note: CNY represents Chinese Yuan as the currency unit in Kubecost, while USD represents US Dollars.

  4. Click SAVE at the bottom of the page to save the configuration and reload the page.