Integrate cost management with OpenShift Container Platform on a restricted network
On restricted or disconnected networks without internet access, configure the Operator Lifecycle Manager to manage local integrations and store cost reports locally for manual upload to Red Hat Hybrid Cloud Console.
- Create a OpenShift Container Platform integration manually.
- Configure the Operator Lifecycle Manager to install and run local integrations.
- Configure the Cost Management Metrics Operator to store cost report CSV files locally using a persistent volume claim (PVC).
- Download cost reports stored in the PVC to a workstation.
- Upload cost reports to Red Hat Hybrid Cloud Console from your workstation.
Manually create an OpenShift Container Platform integration Copy linkLink copied!
Create an OpenShift Container Platform integration manually on Red Hat Hybrid Cloud Console for restricted network installations and other scenarios where automatic integration creation is not available.
Before you begin Copy linkLink copied!
- You have an OpenShift Container Platform cluster installed.
- You are logged into the OpenShift Container Platform web console and have cluster administrator privileges.
Procedure Copy linkLink copied!
-
From Red Hat Hybrid Cloud Console, click Settings Menu
> Integrations.
- Click the Red Hat tab.
- Click Add integration, which opens the Add a cloud integration wizard.
- In Select your integration type, click Red Hat OpenShift Container Platform.
- In Application, click cost management. Then click Next.
- Enter a name in Integration name. Then click Next.
- In a new tab, access the OpenShift Container Platform web console. Go to and copy your Cluster Identifier.
- Back in cost management, enter your Cluster Identifier. Then click Next.
- Review the details and click Add to create the integration.
Results Copy linkLink copied!
- In Red Hat Hybrid Cloud Console, navigate to Settings > Integrations > Red Hat.
- Verify that your new OpenShift Container Platform integration appears in the list with status Active.
Install the cost management operator on a restricted network Copy linkLink copied!
Because remote integrations require full Internet connectivity, Operator Lifecycle Manager (OLM) cannot access OpenShift Container Platform clusters that are installed on restricted (disconnected) networks. You must install and configure OLM to run locally.
Before you begin Copy linkLink copied!
- You installed an OpenShift Container Platform cluster.
- You have a workstation with unrestricted network access.
- You logged in to the OpenShift Container Platform web console and have cluster administrator privileges.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
After a short wait, Cost Management Metrics Operator appears in the Installed Operators tab in Project: all projects or Project: costmanagement-metrics-operator.
Configure the cost operator on a restricted network Copy linkLink copied!
Configure the costmanagement-metrics-operator to store cost reports locally on a persistent volume claim for restricted network environments without internet access.
Before you begin Copy linkLink copied!
- You installed costmanagement-metrics-operator.
- You logged into the OpenShift Container Platform web console and have cluster administrator privileges.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Select the CostManagementMetricsConfig that you created.
- Click YAML view.
- Verify that a report was created by viewing the data in
packaging:packaging: last_successful_packaging_time: `current date and time` max_reports_to_store: 30 max_size_MB: 100 number_of_reports_stored: 1 packaged_files: - >- /tmp/costmanagement-metrics-operator-reports/upload/YYYYMMDDTHHMMSS-cost-mgmt.tar.gzNote After configuration, costmanagement-metrics-operator generates an initial report. These reports are in
packaged_files.
Download cost reports Copy linkLink copied!
If you configured the costmanagement-metrics-operator to run on a restricted network, the reports from the persistent volume claims (PVC) are temporarily stored in a workstation. Copy the reports to an unrestricted network.
Before you begin Copy linkLink copied!
- You have a workstation with unrestricted network access.
- costmanagement-metrics-operator reports in your PVC.
The default configuration saves one week of reports. To avoid losing metrics data, download the reports locally and upload them to Red Hat Hybrid Cloud Console weekly.
You can configure any PVC, but by default, most PVCs are ReadWriteOnce. For ReadWriteOnce PVCs, the volume-shell must be attached to the same node as the operator pod.
Procedure Copy linkLink copied!
Results Copy linkLink copied!
- Verify that the cost report files were copied to your local folder and have the naming format
YYYYMMDDTHHMMSS-cost-mgmt.tar.gz.
What to do next Copy linkLink copied!
View your PVC usage.
+ In the OpenShift tab in Red Hat Hybrid Cloud Console, your PVCs with the highest usage automatically populate under Persistent Volume Claims. To view all PVCs, click more at the end of the section.
+ You can filter your PVC data by the following fields: * Persistent volume claim * Cluster * StorageClass
Upload cost reports to the Red Hat Hybrid Cloud Console Copy linkLink copied!
Manually upload your locally stored cost reports from a restricted network to Red Hat Hybrid Cloud Console. The default configuration saves one week of reports. Download the reports locally and upload them to Red Hat Hybrid Cloud Console weekly to avoid losing metrics data.
Before you begin Copy linkLink copied!
- You created a Bearer token.
- You have costmanagement-metrics-operator reports downloaded locally.
- You are a Red Hat account user with Organization Administrator entitlements.
- You have a workstation with unrestricted network access.
The service account used to upload data must be added to a user group that has the cost management:settings:write permission. When configuring this in the Red Hat Hybrid Cloud Console, ensure that the group’s assigned role includes the cost-management application and the settings resource type with write operations enabled. This is required to access the Ingress Reports application programming interface (API) for data uploads.
Procedure Copy linkLink copied!
client_id and client_secret to your credentials, set FILE_NAME to the report that you want to upload, and enter your Bearer token in $TOKEN:
$ curl -vvvv -F "file=@$FILE_NAME.tar.gz;type=application/vnd.redhat.hccm.tar+tgz" -H "Authorization: Bearer $TOKEN" https://console.redhat.com/api/ingress/v1/upload
Results Copy linkLink copied!
- From cost management, click OpenShift.
- On the OpenShift details page, confirm that you have OpenShift usage data for your cluster.