Upgrading metering

Metering is a deprecated feature. Deprecated functionality is still included in OKD and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments.

For the most recent list of major functionality that has been deprecated or removed within OKD, refer to the Deprecated and removed features section of the OKD release notes.

You can upgrade metering to 4.6 by updating the Metering Operator subscription.

Prerequisites

  • The cluster is updated to 4.6.

  • The Metering Operator is installed from OperatorHub.

    You must upgrade the Metering Operator to 4.6 manually. Metering does not upgrade automatically if you selected the “Automatic” Approval Strategy in a previous installation.

  • The MeteringConfig custom resource is configured.

  • The metering stack is installed.

  • Ensure that metering status is healthy by checking that all pods are ready.

Potential data loss can occur if you modify your metering storage configuration after installing or upgrading metering.

Procedure

  1. Click OperatorsInstalled Operators from the web console.

  2. Select the openshift-metering project.

  3. Click Metering Operator.

  4. Click SubscriptionChannel.

  5. In the Change Subscription Update Channel window, select 4.6 and click Save.

    Wait several seconds to allow the subscription to update before proceeding to the next step.

  6. Click OperatorsInstalled Operators.

    The Metering Operator is shown as 4.6. For example:

    1. Metering
    2. 4.6.0-202007012112.p0 provided by Red Hat, Inc

Verification

You can verify the metering upgrade by performing any of the following checks:

  • Check the Metering Operator cluster service version (CSV) for the new metering version. This can be done through either the web console or CLI.

    Procedure (UI)

    1. Navigate to OperatorsInstalled Operators in the metering namespace.

    2. Click Metering Operator.

    3. Click Subscription for Subscription Details.

    4. Check the Installed Version for the upgraded metering version. The Starting Version shows the metering version prior to upgrading.

    Procedure (CLI)

    • Check the Metering Operator CSV:

      1. $ oc get csv | grep metering

      Example output for metering upgrade from 4.5 to 4.6

      1. NAME DISPLAY VERSION REPLACES PHASE
      2. metering-operator.4.6.0-202007012112.p0 Metering 4.6.0-202007012112.p0 metering-operator.4.5.0-202005252114 Succeeded
  • Check that all required pods in the openshift-metering namespace are created. This can be done through either the web console or CLI.

    Many pods rely on other components to function before they themselves can be considered ready. Some pods may restart if other pods take too long to start. This is to be expected during the Metering Operator upgrade.

    Procedure (UI)

    • Navigate to WorkloadsPods in the metering namespace and verify that pods are being created. This can take several minutes after upgrading the metering stack.

    Procedure (CLI)

    • Check that all required pods in the openshift-metering namespace are created:

      1. $ oc -n openshift-metering get pods

      Example output

      1. NAME READY STATUS RESTARTS AGE
      2. hive-metastore-0 2/2 Running 0 3m28s
      3. hive-server-0 3/3 Running 0 3m28s
      4. metering-operator-68dd64cfb6-2k7d9 2/2 Running 0 5m17s
      5. presto-coordinator-0 2/2 Running 0 3m9s
      6. reporting-operator-5588964bf8-x2tkn 2/2 Running 0 2m40s
  • Verify that the ReportDataSource resources are importing new data, indicated by a valid timestamp in the NEWEST METRIC column. This might take several minutes. Filter out the “-raw” ReportDataSource resources, which do not import data:

    1. $ oc get reportdatasources -n openshift-metering | grep -v raw

    Timestamps in the NEWEST METRIC column indicate that ReportDataSource resources are beginning to import new data.

    Example output

    1. NAME EARLIEST METRIC NEWEST METRIC IMPORT START IMPORT END LAST IMPORT TIME AGE
    2. node-allocatable-cpu-cores 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:56:44Z 23h
    3. node-allocatable-memory-bytes 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:52:07Z 23h
    4. node-capacity-cpu-cores 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:56:52Z 23h
    5. node-capacity-memory-bytes 2020-05-18T21:10:00Z 2020-05-19T19:57:00Z 2020-05-18T19:10:00Z 2020-05-19T19:57:00Z 2020-05-19T19:57:03Z 23h
    6. persistentvolumeclaim-capacity-bytes 2020-05-18T21:09:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:56:46Z 23h
    7. persistentvolumeclaim-phase 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:52:36Z 23h
    8. persistentvolumeclaim-request-bytes 2020-05-18T21:10:00Z 2020-05-19T19:57:00Z 2020-05-18T19:10:00Z 2020-05-19T19:57:00Z 2020-05-19T19:57:03Z 23h
    9. persistentvolumeclaim-usage-bytes 2020-05-18T21:09:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:52:02Z 23h
    10. pod-limit-cpu-cores 2020-05-18T21:10:00Z 2020-05-19T19:57:00Z 2020-05-18T19:10:00Z 2020-05-19T19:57:00Z 2020-05-19T19:57:02Z 23h
    11. pod-limit-memory-bytes 2020-05-18T21:10:00Z 2020-05-19T19:58:00Z 2020-05-18T19:11:00Z 2020-05-19T19:58:00Z 2020-05-19T19:59:06Z 23h
    12. pod-persistentvolumeclaim-request-info 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:52:07Z 23h
    13. pod-request-cpu-cores 2020-05-18T21:10:00Z 2020-05-19T19:58:00Z 2020-05-18T19:11:00Z 2020-05-19T19:58:00Z 2020-05-19T19:58:57Z 23h
    14. pod-request-memory-bytes 2020-05-18T21:10:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:55:32Z 23h
    15. pod-usage-cpu-cores 2020-05-18T21:09:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:54:55Z 23h
    16. pod-usage-memory-bytes 2020-05-18T21:08:00Z 2020-05-19T19:52:00Z 2020-05-18T19:11:00Z 2020-05-19T19:52:00Z 2020-05-19T19:55:00Z 23h
    17. report-ns-pvc-usage 5h36m
    18. report-ns-pvc-usage-hourly

After all pods are ready and you have verified that new data is being imported, metering continues to collect data and report on your cluster. Review a previously scheduled report or create a run-once metering report to confirm the metering upgrade.