This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Installing metering
Metering is a deprecated feature. Deprecated functionality is still included in OpenShift Container Platform 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 OpenShift Container Platform, refer to the Deprecated and removed features section of the OpenShift Container Platform release notes.
Review the following sections before installing metering into your cluster.
To get started installing metering, first install the Metering Operator from OperatorHub. Next, configure your instance of metering by creating a MeteringConfig custom resource (CR). Installing the Metering Operator creates a default MeteringConfig resource that you can modify using the examples in the documentation. After creating your MeteringConfig resource, install the metering stack. Last, verify your installation.
2.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
Metering requires the following components:
-
A
StorageClassresource for dynamic volume provisioning. Metering supports a number of different storage solutions. - 4GB memory and 4 CPU cores available cluster capacity and at least one node with 2 CPU cores and 2GB memory capacity available.
The minimum resources needed for the largest single pod installed by metering are 2GB of memory and 2 CPU cores.
- Memory and CPU consumption may often be lower, but will spike when running reports, or collecting data for larger clusters.
2.2. Installing the Metering Operator Link kopierenLink in die Zwischenablage kopiert!
You can install metering by deploying the Metering Operator. The Metering Operator creates and manages the components of the metering stack.
You cannot create a project starting with openshift- using the web console or by using the oc new-project command in the CLI.
If the Metering Operator is installed using a namespace other than openshift-metering, the metering reports are only viewable using the CLI. It is strongly suggested throughout the installation steps to use the openshift-metering namespace.
2.2.1. Installing metering using the web console Link kopierenLink in die Zwischenablage kopiert!
You can use the OpenShift Container Platform web console to install the Metering Operator.
Procedure
Create a namespace object YAML file for the Metering Operator with the
oc create -f <file-name>.yamlcommand. You must use the CLI to create the namespace. For example,metering-namespace.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
In the OpenShift Container Platform web console, click Operators
OperatorHub. Filter for meteringto find the Metering Operator. - Click the Metering card, review the package description, and then click Install.
- Select an Update Channel, Installation Mode, and Approval Strategy.
- Click Install.
Verify that the Metering Operator is installed by switching to the Operators
Installed Operators page. The Metering Operator has a Status of Succeeded when the installation is complete. NoteIt might take several minutes for the Metering Operator to appear.
- Click Metering on the Installed Operators page for Operator Details. From the Details page you can create different resources related to metering.
To complete the metering installation, create a MeteringConfig resource to configure metering and install the components of the metering stack.
2.2.2. Installing metering using the CLI Link kopierenLink in die Zwischenablage kopiert!
You can use the OpenShift Container Platform CLI to install the Metering Operator.
Procedure
Create a
Namespaceobject YAML file for the Metering Operator. You must use the CLI to create the namespace. For example,metering-namespace.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
Namespaceobject:oc create -f <file-name>.yaml
$ oc create -f <file-name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc create -f openshift-metering.yaml
$ oc create -f openshift-metering.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
OperatorGroupobject YAML file. For example,metering-og:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Subscriptionobject YAML file to subscribe a namespace to the Metering Operator. This object targets the most recently released version in theredhat-operatorscatalog source. For example,metering-sub.yaml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The name is arbitrary.
- 2
- You must specify the
openshift-meteringnamespace. - 3
- Specify 4.8 as the channel.
- 4
- Specify the
redhat-operatorscatalog source, which contains themetering-ocppackage manifests. If your OpenShift Container Platform is installed on a restricted network, also known as a disconnected cluster, specify the name of theCatalogSourceobject you created when you configured the Operator LifeCycle Manager (OLM). - 5
- Specify "Automatic" install plan approval.
2.3. Installing the metering stack Link kopierenLink in die Zwischenablage kopiert!
After adding the Metering Operator to your cluster you can install the components of metering by installing the metering stack.
2.4. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
- Review the configuration options
Create a
MeteringConfigresource. You can begin the following process to generate a defaultMeteringConfigresource, then use the examples in the documentation to modify this default file for your specific installation. Review the following topics to create yourMeteringConfigresource:- For configuration options, review About configuring metering.
- At a minimum, you need to configure persistent storage and configure the Hive metastore.
There can only be one MeteringConfig resource in the openshift-metering namespace. Any other configuration is not supported.
Procedure
-
From the web console, ensure you are on the Operator Details page for the Metering Operator in the
openshift-meteringproject. You can navigate to this page by clicking OperatorsInstalled Operators, then selecting the Metering Operator. Under Provided APIs, click Create Instance on the Metering Configuration card. This opens a YAML editor with the default
MeteringConfigresource file where you can define your configuration.NoteFor example configuration files and all supported configuration options, review the configuring metering documentation.
-
Enter your
MeteringConfigresource into the YAML editor and click Create.
The MeteringConfig resource begins to create the necessary resources for your metering stack. You can now move on to verifying your installation.
2.5. Verifying the metering installation Link kopierenLink in die Zwischenablage kopiert!
You can verify the metering installation by performing any of the following checks:
Check the Metering Operator
ClusterServiceVersion(CSV) resource for the metering version. This can be done through either the web console or CLI.Procedure (UI)
-
Navigate to Operators
Installed Operators in the openshift-meteringnamespace. - Click Metering Operator.
- Click Subscription for Subscription Details.
- Check the Installed Version.
Procedure (CLI)
Check the Metering Operator CSV in the
openshift-meteringnamespace:oc --namespace openshift-metering get csv
$ oc --namespace openshift-metering get csvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME DISPLAY VERSION REPLACES PHASE elasticsearch-operator.4.8.0-202006231303.p0 OpenShift Elasticsearch Operator 4.8.0-202006231303.p0 Succeeded metering-operator.v4.8.0 Metering 4.8.0 Succeeded
NAME DISPLAY VERSION REPLACES PHASE elasticsearch-operator.4.8.0-202006231303.p0 OpenShift Elasticsearch Operator 4.8.0-202006231303.p0 Succeeded metering-operator.v4.8.0 Metering 4.8.0 SucceededCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Navigate to Operators
Check that all required pods in the
openshift-meteringnamespace are created. This can be done through either the web console or CLI.NoteMany 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 installation.
Procedure (UI)
-
Navigate to Workloads
Pods in the metering namespace and verify that pods are being created. This can take several minutes after installing the metering stack.
Procedure (CLI)
Check that all required pods in the
openshift-meteringnamespace are created:oc -n openshift-metering get pods
$ oc -n openshift-metering get podsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Navigate to Workloads
Verify that the
ReportDataSourceresources are beginning to import data, indicated by a valid timestamp in theEARLIEST METRICcolumn. This might take several minutes. Filter out the "-raw"ReportDataSourceresources, which do not import data:oc get reportdatasources -n openshift-metering | grep -v raw
$ oc get reportdatasources -n openshift-metering | grep -v rawCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
After all pods are ready and you have verified that data is being imported, you can begin using metering to collect data and report on your cluster.