此内容没有您所选择的语言版本。

Chapter 3. Enabling cloud rating in a RHOSO environment


Important

This feature is available in this release as a Technology Preview, and therefore is not fully supported by Red Hat. It should only be used for testing, and should not be deployed in a production environment. For more information about Technology Preview features, see Scope of Coverage Details.

Rating is the process of assigning a value to the consumption of computing resources. The Rating service (cloudkitty) monitors, collects, rates and stores metrics data about service consumption in a RHOSO cloud. You can configure the Rating service to associate a value to a metric for a given period.

3.1. Prerequisites

  • The Loki Operator is installed on the RHOCP cluster.
  • Prometheus is enabled in your cluster. Use the following command to check that the Telemetry Operator has metricStorage enabled:

    $ oc patch oscp/openstack --type='json' -p '[{"op": "replace", "path": "/spec/telemetry/template/metricStorage/enabled", "value":true}]'
    Copy to Clipboard Toggle word wrap

    If this command returns False, use the following command to enable metricStorage:

    $ oc patch openstack openstackcontrolplane
     --type merge -p '{"spec":{"metricStorage": true }}'
    Copy to Clipboard Toggle word wrap

    For more information about configuring metricStorage, see Configuring observability on the control plane.

The Telemetry Operator uses a Keystone fetcher to retrieve a list of projects to rate and a Prometheus collector to collect data from a Prometheus source for a given project and metric. The Telemetry Operator does not support using a Gnocchi collector or any other type of fetcher.

Note

The Telemetry Operator does not support the Rating service reprocessing API.

3.2. Enabling the Rating service on the control plane

You can enable the Rating service (cloudkitty) in the Telemetry Operator to provide chargeback and rating capabilities to RHOSO clouds.

Procedure

  1. Create a Secret CR on your workstation to connect Loki to the AWS s3 object storage you use for the Loki log store:

    apiVersion: v1
    kind: Secret
    metadata:
      name: cloudkitty-loki-s3
      namespace: openstack
    stringData:
      access_key_id: <your_key_id>
      access_key_secret: <your_key_secret>
      bucketnames: <your_bucket_name>
      endpoint: <your_s3_endpoint>
    Copy to Clipboard Toggle word wrap
  2. Create the Secret CR in the cluster:

    $ oc create -f loki_s3_secret.yaml -n openstack
    Copy to Clipboard Toggle word wrap
  3. Verify that the Secret CR is created:

    $ oc describe secret logging-loki-s3 -n openstack
    Copy to Clipboard Toggle word wrap
  4. Open the OpenStackControlPlane CR file on your workstation, for example, openstack_control_plane.yaml.
  5. Locate the service definition for telemetry and add the following cloudkitty configuration to enable the Ratings service:

      telemetry:
        enabled: true
          template:
            ...
            cloudkitty:
              enabled: true
              s3StorageConfig:
                schemas:
                - effectiveDate: "2024-11-18"
                  version: v13
                secret:
                  name: cloudkitty-loki-s3
                  type: s3
    Copy to Clipboard Toggle word wrap
  6. Check how long metrics data is being retained for, and ensure that they are not being stored for more than 7 days:

          template:
            metricStorage:
              enabled: true
              ...
              monitoringStack:
                ...
                storage:
                  strategy: persistent
                  retention: 24h
    Copy to Clipboard Toggle word wrap
  7. Ensure that the Loki Operator log store is sized for your environment. For more information, see Loki deployment sizing.
  8. Update the control plane:

    $ oc apply -f openstack_control_plane.yaml -n openstack
    Copy to Clipboard Toggle word wrap
  9. Wait until RHOCP creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status:

    $ oc get openstackcontrolplane -n openstack
    NAME              STATUS  MESSAGE
    openstack-control-plane   Unknown   Setup started
    Copy to Clipboard Toggle word wrap

    The OpenStackControlPlane resources are created when the status is "Setup complete".

    Tip

    Append the -w option to the end of the get command to track deployment progress.

  10. Confirm that the control plane is deployed by reviewing the pods in the openstack namespace:

    $ oc get pods -n openstack
    Copy to Clipboard Toggle word wrap

    The control plane is deployed when all the pods are either completed or running.

Verification

  1. Access the remote shell for the openstackclient pod and verify that the Rating service is enabled:

    $ oc rsh -n openstack openstackclient
    $ openstack rating module list
    +-----------+---------+----------+
    | Module    | Enabled | Priority |
    +-----------+---------+----------+
    | hashmap   | False   | 1        |
    | noop      | True    | 1        |
    | pyscripts | False   | 1        |
    +-----------+---------+----------+
    Copy to Clipboard Toggle word wrap
  2. Ensure that you can enable, disable, and change the priority of each module. For more information about how to use the Rating service, see https://docs.openstack.org/cloudkitty/latest/user/rating/index.html.

3.3. Additional resources

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部