Purpose

The Billing and Cost Management feature is designed to account for, calculate, and analyze resource usage.
It collects data on resource consumption (CPU, memory, storage) across all managed clusters and workspaces.

Main capabilities:

  • View infrastructure costs over time using filters and different data views (Dashboard)
  • Analyze expenses by workspaces, clusters, namespaces, controllers, resources, and labels
  • Create and configure pricing plans for cost calculation
  • Generate on-demand and scheduled reports
  • Export data in CSV format

To fully enable this functionality, you need to:

  1. Enable the feature flag in Deckhouse Commander
  2. Assign billing labels to nodes
  3. Create a pricing plan

Calculation and Aggregation Models

Currently, there are two calculation models implemented:

  • By requests — based on resource requests specified for pods
  • By actual usage — based on the actual resource usage by pods

Two aggregation options are available:

  • By average — metrics are aggregated by hourly averages
  • 95th percentile — metrics are aggregated by the hourly 95th percentile

The minimum time unit used in calculations is 1 hour.

Enabling and Disabling the Functionality

Enabling

By default, the Billing and Cost Management feature is disabled. To enable it, run:

kubectl patch mc commander --type merge --patch '{"spec":{"settings":{"featureFlags":{"billingEnabled":true}}}}'

After enabling, managed clusters will start sending resource consumption data (CPU, memory, storage) to a centralized storage in the Deckhouse Commander management cluster.
The Billing section will appear in the top navigation bar on the workspace list screen or by URL {COMMANDER_ADDRESS}/billing/

If the billing section does not appear, make sure you have access to the section.

Disabling

To disable the functionality, run:

kubectl patch mc commander --type merge --patch '{"spec":{"settings":{"featureFlags":{"billingEnabled":false}}}}'

If needed, manually delete leftover resources:

kubectl -n d8-commander delete pvc -l app=billing-reports
kubectl -n d8-commander delete pvc -l app=billing-prometheus

Access Management

Access to the Billing and Cost Management functionality is configured in the Users and Permissions section, allowing you to define access rights to internal subsections.
Only sections the current user has access to will appear in the sidebar menu.

Resource Names

The following resources are used for access control:

  • billingdashboard — access to the Dashboard and analytics
  • billingtariffs — access to manage pricing plans
  • billingreports — access to manage reports

Creating a Billing Label

The link between a pricing plan and usage metrics is established via the billing.commander.deckhouse.io/name label for compute resources and the storageclass for storage.
The label is assigned to each node through a NodeGroup, and its value is used as a key when specifying resource costs in a pricing plan.

Example:

apiVersion: deckhouse.io/v1
kind: NodeGroup
metadata:
  name: worker
spec:
  cloudInstances:
    classReference:
      kind: YandexInstanceClass
      name: worker
    maxPerZone: 1
    minPerZone: 1
    zones:
    - ru-central1-a
  disruptions:
    approvalMode: Automatic
  nodeTemplate:
    labels:
      node-role/worker: ""
      billing.commander.deckhouse.io/name: a1.large
  nodeType: CloudEphemeral

Dashboard Section

This section is intended for real-time expense analysis.

Main interface elements:

  • Filters and dimensions — Workspace, Cluster, Namespace, Controller, Resource
  • Period — date and time range selection
  • Grouping — by day, week, or month
  • Charts and tables — display costs by selected parameters
  • Total cost — aggregated by the current filter

Notes:

  • All filter values are generated only from available resources.

Rates Section

This section is for administrators and managers.

It allows you to:

  • Create new pricing plans for resources (CPU, Memory, Storage)
  • Set the start date for a pricing plan
  • Edit or delete existing plans

Each pricing plan contains:

  • Pricing plan name
  • Calculation model
  • Link to NodeGroup and StorageClass (billing.commander.deckhouse.io/name and storageclass labels)
  • Resource cost
  • Status (active/inactive)

Notes:

  • Resource pricing is linked via labels assigned to NodeGroups or StorageClasses
  • Only one pricing plan can be active at a time
  • The start date of a pricing plan can be set to any date in the past or future

Creating a Pricing Plan

Important!
Before creating a pricing plan, make sure that all NodeGroups have the label
billing.commander.deckhouse.io/name assigned,
and that all storage classes are defined.

  1. Click Create
  2. Enter the pricing plan name
  3. Select the desired calculation and aggregation model
  4. For compute resources, select the label value billing.commander.deckhouse.io/name
  5. Specify the price per CPU and Memory unit
  6. Click Add Label and specify prices for each label
  7. Repeat the operation for each storageclass in the Storage section
  8. Click Create Pricing Plan

The data will become available from the moment the plan is created.

Reports Section

Used to generate analytical reports on demand or according to a defined schedule.

Main interface elements:

  • All Reports tab — list of reports available for download
  • Scheduled Reports tab — list of report schedules, each of which can be edited or deleted
  • Modal window for configuring report parameters

Creating an Instant Report

  1. Click Create
  2. Enter the report name
  3. Select Instant type
  4. Set the time period
  5. Choose nested columns for breakdown (e.g., Workspace, Cluster, Namespace)
  6. Check Break down by resources to include resource-level detail
  7. Click Save — the report will appear in the list and start generating
  8. After generation completes, the report will be available for download in CSV format (comma-separated, first row — column headers)

Creating a Scheduled Report

  1. Click Create
  2. Enter the report name
  3. Select Scheduled type
  4. Set the start date and frequency
  5. Choose nested columns for breakdown (e.g., Workspace, Cluster, Namespace)
  6. Check Break down by resources for detailed cost analysis
  7. Click Save — the schedule will appear on the Scheduled Reports tab

The report will be generated automatically according to the schedule and will appear under All Reports tab.