Deploying Grafana on Openshift 4
This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.
OpenShift users want access to a Grafana interface in order to build custom dashboards for their cluster and application workloads. The Grafana that shipped with OpenShift was read-only and has been deprecated in OpenShift 4.11 and removed in OpenShift 4.12 .
Since OpenShift uses Prometheus for both Cluster and User Workload metrics, its fairly straight forward to deploy a Grafana instance using the Grafana Operator and then view those cluster metrics and create custom Dashboards.
Grafana Operator
-
Create a namespace for the Grafana Operator to be installed in
-
Deploy the Grafana Operator
-
Wait for the Operator to be ready
Deploy Grafana
-
Add the Managed OpenShift Black Belt helm repo
-
Deploy Grafana
Create Prometheus DataSource
-
Give the Grafana service account the
cluster-monitoring-viewrole -
Get a bearer token for the grafana service account
-
Deploy the prometheus data source
-
Deploy a Dashboard
-
Get the URL for Grafana
-
Browse to the URL from above, log in via your OCP credentials
-
Click Dashboards -> Manage -> grafana-operator -> Cluster Metrics