이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 3. Enabling cloud rating in a RHOSO environment
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
metricStorageenabled:oc patch oscp/openstack --type='json' -p '[{"op": "replace", "path": "/spec/telemetry/template/metricStorage/enabled", "value":true}]'$ oc patch oscp/openstack --type='json' -p '[{"op": "replace", "path": "/spec/telemetry/template/metricStorage/enabled", "value":true}]'Copy to Clipboard Copied! Toggle word wrap Toggle overflow If this command returns
False, use the following command to enablemetricStorage:oc patch openstack openstackcontrolplane --type merge -p '{"spec":{"metricStorage": true }}'$ oc patch openstack openstackcontrolplane --type merge -p '{"spec":{"metricStorage": true }}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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.
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
Create a
SecretCR on your workstation to connect Loki to the AWS s3 object storage you use for theLokilog store:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
SecretCR in the cluster:oc create -f loki_s3_secret.yaml -n openstack
$ oc create -f loki_s3_secret.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
SecretCR is created:oc describe secret logging-loki-s3 -n openstack
$ oc describe secret logging-loki-s3 -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the
OpenStackControlPlaneCR file on your workstation, for example,openstack_control_plane.yaml. Locate the service definition for
telemetryand add the followingcloudkittyconfiguration to enable the Ratings service:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check how long metrics data is being retained for, and ensure that they are not being stored for more than 7 days:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Ensure that the Loki Operator log store is sized for your environment. For more information, see Loki deployment sizing.
Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:oc get openstackcontrolplane -n openstack NAME STATUS MESSAGE openstack-control-plane Unknown Setup started
$ oc get openstackcontrolplane -n openstack NAME STATUS MESSAGE openstack-control-plane Unknown Setup startedCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
OpenStackControlPlaneresources are created when the status is "Setup complete".TipAppend the
-woption to the end of thegetcommand to track deployment progress.Confirm that the control plane is deployed by reviewing the pods in the
openstacknamespace:oc get pods -n openstack
$ oc get pods -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow The control plane is deployed when all the pods are either completed or running.
Verification
Access the remote shell for the
openstackclientpod and verify that the Rating service is enabled:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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.