Installation

This article will introduce how to install the components required for metering and billing.

TOC

Preinstall 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.

  • Cost Management Server supports deployment in any cluster, but the platform currently only supports deploying one server. Do not deploy multiple servers, as this may cause abnormal issues such as data duplication.

  • 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 the ACP Monitor with Prometheus monitoring component installed. Please ensure that this component is successfully installed in advance.

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

  1. Log in to the cluster where the ACP Log Storage with Clickhouse plugin is installed and obtain ClickHouse integration information:

    # Obtain Clickhouse connection address
    kubectl get feature log-center -o jsonpath='{.spec.accessInfo.clickhouse.address}'
    
    # Obtain Clickhouse username and password:
    kubectl get secret -n cpaas-system clickhouse-basic-auth -o jsonpath={.data.username}|base64 -d
    kubectl get secret -n cpaas-system clickhouse-basic-auth -o jsonpath={.data.password}|base64 -d
  2. In the left navigation bar, click Marketing Place > Plugin Management.

  3. Select the cluster which you plan to install the plugin.

  4. Find the Cost Management Server plugin and click the Install button in the right actions bar.

  5. Refer to the following description to configure the relevant parameters.

    ParameterDescription
    Clickhouse AddressConfigure the Clickhouse connection address
    Clickhouse Cluster NameThe cluster name for Clickhouse; the default for platform-created Clickhouse is replicated.
    Clickhouse Secret NameConfigure the Secret for Clickhouse username and password
    Currency UnitChoose the currency unit to display expenses.
  6. 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

  1. Check available versions

    Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the global cluster:

    # kubectl get moduleplugin | grep cost-server
    cost-server                       30h
    # kubectl get moduleconfig | grep cost-server
    cost-server-v4.1.0                30h

    This indicates that the ModulePlugin cost-server exists in the cluster and version v4.1.0 is published.

  2. Create a ModuleInfo

    Create a ModuleInfo resource to install the plugin without any configuration parameters:

    kind: ModuleInfo
    apiVersion: cluster.alauda.io/v1alpha1
    metadata:
      name: global-cost-server
      labels:
        cpaas.io/cluster-name: global
        cpaas.io/module-name: cost-server
        cpaas.io/module-type: plugin
    spec:
      version: v4.1.0
      config:
        global:
          clickhouse:
            address: https://xxx.xxx.xxx.xxx:xx/clickhouse
            authSecret: clickhouse-basic-auth
            cluster: replicated
          currency: CNY(¥)

    YAML field reference (cost-server):

    Field pathDescription
    metadata.labels.cpaas.io/cluster-nameTarget cluster name where the plugin is installed.
    metadata.labels.cpaas.io/module-nameMust be cost-server.
    metadata.labels.cpaas.io/module-typeMust be plugin.
    metadata.nameModuleInfo name (e.g., <cluster>-cost-server).
    spec.versionPlugin version to install.
    spec.config.global.clickhouse.addressConfigure the Clickhouse connection address.
    spec.config.global.clickhouse.authSecretConfigure the Secret for Clickhouse username and password.
    spec.config.global.clickhouse.clusterThe cluster name for Clickhouse; the default for platform-created Clickhouse is replicated.
    spec.config.global.currencyChoose the currency unit to display expenses. Support: CNY(¥)/USD($)/THB(฿)/RUB(₽)/AUD(AU$)/CAD(CA$)/CHF(Fr.)/DKK(kr.)/EUR(€)/GBP(£)/IDR(Rp)/INR(₹)/JPY(JP¥)/HKD(HK)/SGD(SG$)
  3. Verify installation

    Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:

    kubectl get moduleinfo -l cpaas.io/module-name=cost-server
    NAME                                             CLUSTER         MODULE            DISPLAY_NAME     STATUS    TARGET_VERSION   CURRENT_VERSION   NEW_VERSION
    global-e671599464a5b1717732c5ba36079795          global          cost-server       cost-server      Running   v4.1.0           v4.1.0            v4.1.0

    Field explanations:

    • NAME: ModuleInfo resource name
    • CLUSTER: Cluster where the plugin is installed
    • MODULE: Plugin name
    • DISPLAY_NAME: Display name of the plugin
    • STATUS: Installation status; Running means successfully installed and running
    • TARGET_VERSION: Intended installation version
    • CURRENT_VERSION: Version before installation
    • NEW_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

  1. In the left navigation bar, click Marketing Place > Plugin Management.

  2. Select the global cluster.

  3. Find the Cost Management Server plugin and click the Install button in the right actions bar.

  4. Select the cluster name which installed the Cost Management Server plugin

  5. 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.
  1. Check available versions

    Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the global cluster:

    # kubectl get moduleplugin | grep cost-api
    cost-api                       30h
    # kubectl get moduleconfig | grep cost-api
    cost-api-v4.1.0                30h

    This indicates that the ModulePlugin cost-api exists in the cluster and version v4.1.0 is published.

  2. Create a ModuleInfo

    Create a ModuleInfo resource to install the plugin without any configuration parameters:

    kind: ModuleInfo
    apiVersion: cluster.alauda.io/v1alpha1
    metadata:
      name: global-cost-api
      labels:
        cpaas.io/cluster-name: global
        cpaas.io/module-name: cost-api
        cpaas.io/module-type: plugin
    spec:
      version: v4.1.0
      config:
        crossClusterDependency:
          costServer: business-1

    YAML field reference (cost-api):

    Field pathDescription
    metadata.labels.cpaas.io/cluster-nameMust be global.
    metadata.labels.cpaas.io/module-nameMust be cost-api.
    metadata.labels.cpaas.io/module-typeMust be plugin.
    metadata.nameModuleInfo name (e.g., <cluster>-cost-api).
    spec.versionPlugin version to install.
    spec.config.crossClusterDependency.costServerConfigure the cluster name which installed the Cost Management Server plugin
  3. Verify installation

    Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:

    kubectl get moduleinfo -l cpaas.io/module-name=cost-api
    NAME                                             CLUSTER         MODULE            DISPLAY_NAME     STATUS    TARGET_VERSION   CURRENT_VERSION   NEW_VERSION
    global-e671599464a5b1717732c5ba36079795          global          cost-api          cost-api         Running   v4.1.0           v4.1.0            v4.1.0

    Field explanations:

    • NAME: ModuleInfo resource name
    • CLUSTER: Cluster where the plugin is installed
    • MODULE: Plugin name
    • DISPLAY_NAME: Display name of the plugin
    • STATUS: Installation status; Running means successfully installed and running
    • TARGET_VERSION: Intended installation version
    • CURRENT_VERSION: Version before installation
    • NEW_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 the ACP Monitor with Prometheus monitoring component installed. Please ensure that this component is successfully installed in advance.

  • 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

  1. In the left navigation bar, click Marketing Place > Plugin Management.

  2. Select the cluster where this plugin needs to be installed.

  3. Find the Cost Management Agent plugin and click the Install button in the right actions bar.

  4. Select the cluster name which installed the Cost Management Server plugin

  5. Click Install.

Install the Cost Management Agent Plugin via YAML

Prerequisites

  • The Cost Management Agent Plugin component requires that the corresponding cluster has the ACP Monitor with Prometheus monitoring component installed. Please ensure that this component is successfully installed in advance.

  • 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

  1. Check available versions

    Ensure the plugin has been published by checking for ModulePlugin and ModuleConfig resources, in the global cluster:

    # kubectl get moduleplugin | grep cost-agent
    cost-agent                       30h
    # kubectl get moduleconfig | grep cost-agent
    cost-agent-v4.1.0                30h

    This indicates that the ModulePlugin cost-agent exists in the cluster and version v4.1.0 is published.

  2. Create a ModuleInfo

    Create a ModuleInfo resource to install the plugin without any configuration parameters:

    kind: ModuleInfo
    apiVersion: cluster.alauda.io/v1alpha1
    metadata:
      name: global-cost-agent
      labels:
        cpaas.io/cluster-name: global
        cpaas.io/module-name: cost-agent
        cpaas.io/module-type: plugin
    spec:
      version: v4.1.0
      config:
        crossClusterDependency:
          costServer: business-1

    YAML field reference (cost-agent):

    Field pathDescription
    metadata.labels.cpaas.io/cluster-nameTarget cluster name where the plugin is installed.
    metadata.labels.cpaas.io/module-nameMust be cost-agent.
    metadata.labels.cpaas.io/module-typeMust be plugin.
    metadata.nameModuleInfo name (e.g., <cluster>-cost-agent).
    spec.versionPlugin version to install.
    spec.config.crossClusterDependency.costServerConfigure the cluster name which installed the Cost Management Server plugin
  3. Verify installation

    Since the ModuleInfo name changes upon creation, locate the resource via label to check the plugin status and version:

    kubectl get moduleinfo -l cpaas.io/module-name=cost-agent
    NAME                                             CLUSTER         MODULE            DISPLAY_NAME     STATUS    TARGET_VERSION   CURRENT_VERSION   NEW_VERSION
    global-e671599464a5b1717732c5ba36079795          global          cost-agent        cost-agent       Running   v4.1.0           v4.1.0            v4.1.0