Containers, Kubernetes, OpenShift on Power

 View Only

Red Hat Insights cost management on IBM Power

By Jason Cho posted Mon March 04, 2024 06:00 PM

  

Red Hat Insights Cost Management on IBM Power

Red Hat Insights cost management for OpenShift is a SaaS offering that provides users cost visibility across their hybrid cloud environments. The Cost Management Metrics Operator obtains OpenShift usage data by querying Prometheus every hour to create usage reports which are then uploaded to the Red Hat Hybrid Cloud Console at console.redhat.com to be processed and viewed.

Red Hat Insights cost management is now available on IBM Power with the latest release version 3.2

How to Install

Red Hat Cost Insights cost management is available to be installed as an Operator on Openshift Container Platform.

Red Hat Insights cost management version 3.2 is supported on OpenShift 4.14 and 4.15.  To get started with OpenShift, you can refer to Install on IBM Power and Install on IBM Power Virtual Server.

Please visit Cost Management Metrics Operator release page for detailed information.

How to Upload and View Cluster Costs

Once the operator is installed and configured, the default method is for an user to connect their cluster to Red Hat by adding a Red Hat integration using the Cluster ID as the cluster identifier. After uploading the cluster ID, it takes about 24 hours for cost management to process. Cost reports would then be automatically uploaded to the Red Hat Hybrid Console.

example to upload a red hat integration

However, if an user doesn't want to automatically connect their cluster to Red Hat, they can manually submit data by first creating a CostManagementMetricsConfig. To create a config, users would first have to create a secret with their Red Hat credentials. This config provides reports based on usage of the cluster and reports can be extracted as a tarball file.

To manually upload cost reports to the Hybrid Cloud Console, they need to be downloaded from the operator and copied from the PVC generated by the config.

  • First create the following pod, ensuring the claimName matches the PVC. The pod configuration saves one week of reports which means the process of uploading and downloading reports should be repeated weekly to prevent loss of data.
kind: Pod
apiVersion: v1
metadata:
  name: volume-shell
  namespace: costmanagement-metrics-operator
  labels:
    app: costmanagement-metrics-operator
spec:
  volumes:
  - name: costmanagement-metrics-operator-reports
    persistentVolumeClaim:
      claimName: costmanagement-metrics-operator-data
  containers:
  - name: volume-shell
    image: busybox
    command: ['sleep', 'infinity']
    volumeMounts:
    - name: costmanagement-metrics-operator-reports
      mountPath: /tmp/costmanagement-metrics-operator-reports
  • Use rsync to copy all the files ready for upload from the PVC to a local repository
$ oc rsync volume-shell:/tmp/costmanagement-metrics-operator-reports/upload local/path/to/save/folder
  • Once the files have been successfully copied, use rsh to connect to the pod and delete the contents of the repository so they are no longer in storage
$ oc rsh volume-shell
$ rm /tmp/costmanagement-metrics-operator-reports/upload/*
  • The tarball file can then be uploaded to cost management via the curl command.
$ curl -vvvv -F "file=@FILE_NAME.tar.gz;type=application/vnd.redhat.hccm.tar+tgz"  https://console.redhat.com/api/ingress/v1/upload -u USERNAME:PASS

Users would then have to create their own cost models by creating rates for CPU, memory, node, and PVC usage.  Rates are calculated per hour. Here an example of the menu to create a cost model on the Hybrid Cloud Console.

Menu to create a cost model

After uploading the Red Hat Integration or cluster usage report and after creating cost models, here's an example of what the cost report would look like on console.redhat.com

Example of a cost report on console.redhat.com after creating a cost model

Please refer to this video Demo: Cost Management Metrics Operator in and Air-Gapped environment as well as the Product Documentation for a detailed visual explanation to install and use Red Hat Insights cost management in a disconnected configuration mode.

Summary

Red Hat Insights cost management is a tool for users to view usage and costs for their hybrid cloud applications.

This blog describes how to build and use Red Hat Insights cost management for IBM Power.

Permalink