Cost Model Management

INFO

Cost models help you define the resources and unit prices that need to be billed in clusters. The platform will measure and bill for each cluster based on the cost model.

TOC

Overview

Cost model management allows platform administrators to define and manage billing models for different clusters. Only clusters associated with a cost model will generate billing data.

Day 1 Deployment:

  • After platform deployment and metering/billing service installation, no cost models exist initially
  • No billing will occur until cost models are created and associated with clusters
  • Administrators need to create cost models and bind them to clusters
  • Billing data will be available starting from the next hour

Day 2 Operations:

  • Description changes take effect immediately
  • Other modifications (pricing, cluster bindings, billing items) take effect in the next billing cycle
  • Changes do not affect previously generated billing records

Cost Model List

The cost model list displays all cost models in the platform and supports basic management operations.

Accessing the Cost Model List

  1. In the left navigation bar, click Metering and Billing > Cost Models.

  2. The cost model list page displays the following information:

    • Name: Click to view cost model details
    • Description: Brief description of the cost model
    • Associated Clusters: Clusters bound to this cost model (displayed as labels)
    • Creator: User who created the cost model
    • Created Time: When the cost model was created
  3. Available operations:

    • Create Cost Model: Click to open the create cost model dialog
    • Search: Search cost models by name
    • Delete: Delete cost models (disabled for models with associated clusters)

Creating a Cost Model

  1. On the cost model list page, click Create Cost Model.

  2. Fill in the basic information:

    • Name: Required field with appropriate naming restrictions
    • Description: Optional text description
  3. Configure associated clusters:

    • Select from all available clusters in the platform
    • Clusters already associated with other cost models cannot be selected
    • Clusters without metering/billing client components cannot be selected
    • Option to select all clusters is available
  4. Configure the price list:

    • Click Add to open the add price dialog
    • Configure billing items, billing methods, and prices
    • Support for label-based differentiated pricing
  5. Click Create to save the cost model.

Price Configuration

Adding Prices

In the add price dialog, configure the following:

Billing Item: Select from available options (CPU, Memory, Storage)

Billing Method: Select based on the chosen billing item:

  • CPU Options:

    • Usage (core-hours): Based on actual CPU consumption
    • Request (core-hours): Based on CPU resource requests
    • Effective Usage (core-hours): Higher of usage or request
    • Project Quota (core-hours): Based on project-level CPU quotas
  • Memory Options:

    • Usage (Gi-hours): Based on actual memory consumption
    • Request (Gi-hours): Based on memory resource requests
    • Effective Usage (Gi-hours): Higher of usage or request
    • Project Quota (Gi-hours): Based on project-level memory quotas
  • Storage Options:

    • Request Volume (Gi-hours): Based on PV request size

Default Price: Base price for the billing item (required, minimum 0, up to 2 decimal places)

Price by Label: Optional feature for dynamic pricing based on labels

  • Label Key: Maximum 63 characters
  • Label Value Groups: Define different prices for different label values
  • Price: Price for specific label values
  • Comment: Optional notes for the price group

When enabled, the platform matches billing records against configured labels and uses the corresponding unit price. If no match is found, the default unit price is used.

Modifying Prices

  1. In the cost model details page, click Edit for the price item you want to change.

  2. The modify price dialog appears with the same fields as the add dialog, except:

    • Billing Item and Billing Method are fixed and cannot be modified
    • All other fields can be updated
  3. Click Edit to save changes.

Cost Model Details

The cost model details page provides comprehensive information about a specific cost model.

Viewing Cost Model Details

  1. From the cost model list, click on a cost model name to view its details.

  2. The details page displays:

Basic Information:

  • Description: With inline editing capability
  • Associated Clusters: Displayed as labels with inline editing capability
  • Creator: User who created the cost model
  • Created Time: When the cost model was created

Price List:

  • Complete list of configured billing items and methods
  • Add Price: Button to add new price configurations
  • EditDelete: Actions available for each price item

Editing Cost Model Details

Description: Click the edit button to modify the description inline. Changes take effect immediately.

Associated Clusters: Click the edit button to modify cluster associations. The same validation rules apply as during creation:

  • Cannot select clusters already associated with other cost models
  • Cannot select clusters without metering/billing client components

Price List:

  • Add new price configurations using the Add Price button
  • Modify existing prices using the Edit button for each item
  • Delete price items using the Delete button (requires confirmation)

Price By Label

The price by label feature allows you to set different prices for different label values.

  • The labels we currently support are obtained from Prometheus, and the specific metrics are: kube_pod_labels.
  • The product currently defaults to collecting these labels from the pod into the kube_pod_labels metric: app,mon,osd,mds,mgr,rgw,service_name,middleware.instance/name,middleware.instance/type.
  • The project quota billing method currently does not support using Price By Label. If you need it, you can contact our technical personnel.

Adding Custom Labels

If you need to add more labels, please follow the procedure below:

  1. Log in to the global control plane node and modify the corresponding moduleinfo.yaml file.

  2. For Prometheus, follow the procedure below:

    kubectl get moduleinfo -A | grep prometheus | grep <cluster-name>
    
    kubectl edit moduleinfo
    ---
    spec:
    valuesOverride:
       ait/chart-kube-prometheus:
          exporter-kube-state:
          additionalPodLabels:
          - label1
          - label2                      #Add custom Labels in this format
    ---
  3. After modifying the moduleinfo.yaml file, waiting for the restart of the Prometheus service to take effect.