Installation
This article will introduce how to install the components required for metering and billing.
TOC
Preinstall ConsiderationsInstall the Cost Management Server Plugin via ConsolePrerequisitesProcedureInstall the Cost Management Server Plugin via YAMLPrerequisitesProcedureInstall the Cost Management Essentials Plugin via ConsolePrerequisitesProcedureInstall the Cost Management Essentials Plugin via YAMLPrerequisitesInstall the Cost Management Agent Plugin via ConsolePrerequisitesProcedureInstall the Cost Management Agent Plugin via YAMLPrerequisitesProcedureEnable Required Metrics for VictoriaMetrics on Versions Earlier Than 4.4.0PrerequisitesProcedureVerificationPreinstall Considerations
-
Download the latest version of the Cost Management Plugin from Custom Portal and upload it to the platform by
violet. -
The Cost Management Server, Cost Management Essentials and Cost Management Agent work together to provide the overall metering and billing functionality of the platform. The server-side component supports data storage capabilities related to metering and billing, while the client-side component handles data collection and billing capabilities.
-
The Cost Management Server component relies on ClickHouse as its data storage solution. You can either install the ACP Log Storage with Clickhouse plugin provided by the platform or install ClickHouse on your own for integration.
-
The Cost Management Essentials needs to integrate with the Cost Management Server component.
-
The Cost Management Agent component requires that the corresponding cluster has a monitoring component installed, either ACP Monitor with Prometheus or ACP Monitor with VictoriaMetrics. Please ensure that one of them is successfully installed in advance. For VictoriaMetrics clusters running an Alauda Container Platform version earlier than 4.4.0, see Enable Required Metrics for VictoriaMetrics on Versions Earlier Than 4.4.0.
Install the Cost Management Server Plugin via Console
Prerequisites
- The Cost Management Server Plugin component relies on ClickHouse as its data storage solution. You can either install the ACP Log Storage with Clickhouse plugin provided by the platform or install ClickHouse on your own for integration.
Procedure
-
Log in to the cluster where the ACP Log Storage with Clickhouse plugin is installed and obtain ClickHouse integration information:
-
In the left navigation bar, click Marketing Place > Plugin Management.
-
Select the cluster which you plan to install the plugin.
-
Find the Cost Management Server plugin and click the Install button in the right actions bar.
-
Refer to the following description to configure the relevant parameters.
-
Click Install.
Install the Cost Management Server Plugin via YAML
Prerequisites
- The Cost Management Server Plugin component relies on ClickHouse as its data storage solution. You can either install the ACP Log Storage with Clickhouse plugin provided by the platform or install ClickHouse on your own for integration.
Procedure
-
Check available versions
Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the
globalcluster:This indicates that the ModulePlugin
cost-serverexists in the cluster and versionv4.1.0is published. -
Create a ModuleInfo
Create a ModuleInfo resource to install the plugin without any configuration parameters:
YAML field reference (cost-server):
-
Verify installation
Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:
Field explanations:
NAME: ModuleInfo resource nameCLUSTER: Cluster where the plugin is installedMODULE: Plugin nameDISPLAY_NAME: Display name of the pluginSTATUS: Installation status;Runningmeans successfully installed and runningTARGET_VERSION: Intended installation versionCURRENT_VERSION: Version before installationNEW_VERSION: Latest available version for installation
Install the Cost Management Essentials Plugin via Console
Prerequisites
- The Cost Management Essentials Plugin needs to integrate with the Cost Management Server component. So you need to install the Cost Management Server plugin first.
Procedure
-
In the left navigation bar, click Marketing Place > Plugin Management.
-
Select the
globalcluster. -
Find the Cost Management Server plugin and click the Install button in the right actions bar.
-
Select the cluster name which installed the
Cost Management Server plugin -
Click Install.
Install the Cost Management Essentials Plugin via YAML
Prerequisites
- The Cost Management Essentials Plugin needs to integrate with the Cost Management Server component. So you need to install the Cost Management Server plugin first.
-
Check available versions
Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the
globalcluster:This indicates that the ModulePlugin
cost-apiexists in the cluster and versionv4.1.0is published. -
Create a ModuleInfo
Create a ModuleInfo resource to install the plugin without any configuration parameters:
YAML field reference (cost-api):
-
Verify installation
Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:
Field explanations:
NAME: ModuleInfo resource nameCLUSTER: Cluster where the plugin is installedMODULE: Plugin nameDISPLAY_NAME: Display name of the pluginSTATUS: Installation status;Runningmeans successfully installed and runningTARGET_VERSION: Intended installation versionCURRENT_VERSION: Version before installationNEW_VERSION: Latest available version for installation
Install the Cost Management Agent Plugin via Console
Prerequisites
-
The Cost Management Agent Plugin component requires that the corresponding cluster has a monitoring component installed, either ACP Monitor with Prometheus or ACP Monitor with VictoriaMetrics. Please ensure that one of them is successfully installed in advance. For VictoriaMetrics clusters running an Alauda Container Platform version earlier than 4.4.0, see Enable Required Metrics for VictoriaMetrics on Versions Earlier Than 4.4.0.
-
The Cost Management Agent Plugin needs to integrate with the Cost Management Server component. So you need to install the Cost Management Server plugin first.
Procedure
-
In the left navigation bar, click Marketing Place > Plugin Management.
-
Select the cluster where this plugin needs to be installed.
-
Find the Cost Management Agent plugin and click the Install button in the right actions bar.
-
Select the cluster name which installed the
Cost Management Server plugin -
Click Install.
Install the Cost Management Agent Plugin via YAML
Prerequisites
-
The Cost Management Agent Plugin component requires that the corresponding cluster has a monitoring component installed, either ACP Monitor with Prometheus or ACP Monitor with VictoriaMetrics. Please ensure that one of them is successfully installed in advance. For VictoriaMetrics clusters running an Alauda Container Platform version earlier than 4.4.0, see Enable Required Metrics for VictoriaMetrics on Versions Earlier Than 4.4.0.
-
The Cost Management Agent Plugin needs to integrate with the Cost Management Server component. So you need to install the Cost Management Server plugin first.
Procedure
-
Check available versions
Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the
globalcluster:This indicates that the ModulePlugin
cost-agentexists in the cluster and versionv4.1.0is published. -
Create a ModuleInfo
Create a ModuleInfo resource to install the plugin without any configuration parameters:
YAML field reference (cost-agent):
-
Verify installation
Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:
Enable Required Metrics for VictoriaMetrics on Versions Earlier Than 4.4.0
Metering and billing supports both Prometheus and VictoriaMetrics as the monitoring component of the metered cluster.
On Alauda Container Platform 4.4.0 and later, VictoriaMetrics collects all metrics required by metering and billing, so no extra configuration is needed. On earlier versions, the kube-state-metrics allowlist shipped with VictoriaMetrics does not contain all of them, and the missing metrics have to be enabled manually.
If these metrics are missing, the Cost Management Agent cannot build Pod allocations. The cost details and usage statistics will contain no Pod-level data at all, while project quota billing still works. Complete this configuration before installing the Cost Management Agent.
Prerequisites
- The monitoring component of the metered cluster is ACP Monitor with VictoriaMetrics, and the Alauda Container Platform version is earlier than 4.4.0.
- You can access the
globalcluster with a user who is allowed to update theModuleInforesources.
Procedure
Perform the following steps on the global cluster, once for each metered cluster whose monitoring component is VictoriaMetrics.
-
Locate the VictoriaMetrics ModuleInfo of the metered cluster:
-
Add the missing metrics to
spec.valuesOverride:additionalKeepMetricsis merged with the built-in allowlist, and applies both to the metrics exposed by kube-state-metrics and to the metrics kept when they are scraped. Do not patch the renderedDeploymentorVMServiceScrapeobjects directly: such a change is recorded as aResourcePatchand replayed on every subsequent chart deployment, and patching only one of the two places has no effect. -
Wait about 2 minutes for the plugin to converge, and confirm that all releases are ready:
Verification
-
On the metered cluster, confirm that kube-state-metrics exposes the metrics:
-
On the metered cluster, confirm that the metrics are kept when they are scraped:
The eight metrics listed above must appear in the output of both commands. After they are collected, the Cost Management Agent starts producing Pod-level metering data from the next collection cycle.