このコンテンツは選択した言語では利用できません。

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

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る