How to streamline cost management on Microsoft Azure Red Hat OpenShift

In this hands-on learning path created by Alireza Rahmani and Jerome Boutaud, you will learn how to use cost management for Red Hat® OpenShift® on Microsoft Azure Red Hat OpenShift to monitor and optimize workload costs.

In this hands-on learning path created by Alireza Rahmani and Jerome Boutaud, you will learn how to use cost management for Red Hat® OpenShift® on Microsoft Azure Red Hat OpenShift to monitor and optimize workload costs.

Installing and integrating Red Hat OpenShift Container Platform data into cost management

15 mins

In this resource, we’ll begin the process of using cost management for Red Hat® OpenShift® by installing the OpenShift Cost Management Metrics Operator and integrating Red Hat OpenShift Container Platform (OCP) data into the tool.

What will you learn?

  • Installing and configuring the Cost Management Metrics Operator

What do you need before starting?

Installing and integrating OCP data into cost management

In this resource, we’ll begin the process of using cost management for Red Hat OpenShift by installing the OpenShift Cost Management Metrics Operator and integrating Red Hat OpenShift Container Platform (OCP) data into the tool.

  1. Confirm that your Azure Red Hat OpenShift cluster is ready from the Azure Portal.
     

    Azure Portal view showing cluster status
    In the Azure Portal, your cluster should show that it's ready and available.

     

  2. Log in to the OpenShift Console.
     

    Log in screen for the OpenShift console
    Log in to the OpenShift Console with your Red Hat credentials.
  3. Click Administrator > Operators > OperatorHub and search for “Cost Management Metrics Operator.”
     

    View of OperatorHub with Cost Management Metrics Operator in the search results
    Search OperatorHub for the Cost Management Metrics operator.
  4. Click the Cost Management Metrics Operator and click Install.
     

    Details about the Cost Management Metrics Operator
    Install the Cost Management Metrics Operator from the OperatorHub.
  5. Under Installation mode, select “A specific namespace on the cluster.” Use the Operator-recommended namespace, costmanagement-metrics-operator, in the next section.
     

    Installation wizard for Cost Management Metrics Operator with namespace defined
    Define the namespace in the Cost Management Metrics Operator installation wizard.
  6. Get your username and password for https://console.redhat.com/. We are going to create a secret and provide this information to the cost management operator.
  7. Click Workloads > Secrets > Project: costmanagement-metrics-operator > Create Key/value secret.
     

    View of the key/value secrets for the project with the Create dropdown menu selected
    Create the key/value secret from the Secrets manager for your project.
  8. Fill in the following information: 
    1. Secret name: basic-auth-secret
    2. Key/Value username: XXX (choose your own)
    3. password: XXX (choose your own)
       

      View of the Create Key/Value Secret wizard.
      Define the secret name, key/value username, and password in the Key/Value Secret wizard.

       

      Confirmation that the username and password have been defined
      Your defined password and username will then be visible.

       

      View of the Secrets manager with new secret created
      You will now see your secret in the Secrets manager.
    4. Click Administrator > Operators > Installed Operators and check the Cost Management Metrics Operator.
       

      View of Installed Operators with the Cost Management Metrics Operator installed
      The installed Cost Management Metrics Operator will now show under Installed Operators.
  9. Create the CostManagementMetricsConfig instance.
     

    YAML view of the CostManagementMetricsConfig instance being created
    Create the CostManagementMetricsConfig instance in YAML view.
  10. Update the following parameters:
    1. source: 
       create_source: false
       name: ‘’
    2. source: 
       create_source: true
       name: ‘cost-aro’
       ##name should be unique
    3. spec:
       authentication:
       type: token
    4. spec:
       authentication:
        secret_name: basic-auth-secret
        type: basic

You are now ready to integrate Microsoft Azure data into the cost management service.

Previous resource
What is cost management?
Next resource
Integrating Azure data

This learning path is for operations teams or system administrators

Developers may want to check out Learn Kubernetes using the Developer Sandbox for Red Hat OpenShift on developers.redhat.com.

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.