Enabling OpenShift Container Platform monitoring and implementing Grafana

OpenShift-only contentRed Hat® OpenShift® provides a preconfigured monitoring stack that you can use to monitor the core platform components and to enable monitoring of user-defined projects. You can also implement Grafana by installing the community-based Grafana Operator.

Before you begin

Ensure that you have cluster administrator authority with cluster-admin permissions.

About this task

Enabling the OpenShift monitoring stack

If not already done, configure the monitoring stack that is installed by default during the OpenShift installation in your cluster.

For information about monitoring, see About OpenShift Container Platform monitoring in the Red Hat OpenShift documentation.

Procedure

To enable OpenShift Container Platform monitoring, complete the following steps:

  1. Ensure that the core OpenShift monitoring components are configured by creating a cluster monitoring ConfigMap object that is named cluster-monitoring-config. To enable user-defined projects (namespaces) to be monitored in the cluster in addition to the default platform monitoring, add the enableUserWorkload: true setting to the ConfigMap custom resource as shown in the following example.
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        enableUserWorkload: true
  2. Ensure that any additional configuration that you require is applied; for example, user-defined workload monitoring, persistent storage, or the retention time for Prometheus metrics data.

    For more information, see Configuring core platform monitoring in the Red Hat OpenShift documentation.

  3. Grant permissions to enable users to monitor metrics that are provided through service endpoints and to monitor running pods in their projects.

    For more information about enabling monitoring for user-defined projects and granting user permissions for monitoring the projects, see Enabling monitoring for user-defined projects in the Red Hat OpenShift documentation.

Implementing Grafana

If you want to implement Grafana, you can install the community-based Operator and then create or import custom Grafana dashboards.

Procedure

To implement Grafana, complete the following steps:

  1. Install the community-based Grafana Operator. For more information, see Grafana Operator and https://github.com/grafana-operator/grafana-operator.
    Note: Before you install this Operator, confirm that you have sufficient Red Hat OpenShift entitlement to install community software. If you are using IBM Cloud Pak for Integration, be aware that entitlement from the OpenShift restricted licenses, which are included with IBM Cloud Pak for Integration, cannot be used for this purpose.
  2. Create a Grafana instance.
  3. Create a Grafana dashboard in the Grafana instance and configure a data source for the dashboard.
    You can alternatively import a custom dashboard. To help you get started, you can use the Grafana dashboard sample .json file at https://github.com/IBM/ibm-integration/tree/main/kubernetes/grafana-dashboards. To import this file as a custom dashboard, complete the following steps:
    1. Log in to the Grafana UI.
    2. From the navigation pane, click the Dashboards icon.
    3. Click New and select + Import.
    4. Import the ibm-ace.json file at https://github.com/IBM/ibm-integration/blob/main/kubernetes/grafana-dashboards/ibm-ace.json, which provides a sample dashboard for monitoring integration servers and integration runtimes. For example, you can paste the JSON text directly into the text area.
      An example of the monitoring view is as follows.
      Imported sample dashboard