Installing Grafana

Installing Grafana is very easy, as we can directly use its Docker image, which is available in the Docker.io referencing it on the OpenShift command given in the following steps:

  1. First of all, we need to deploy Grafana on OpenShift by issuing the following commands:
./oc new-app grafana/grafana

--> Found Docker image d0454da (3 days old) from Docker Hub for "grafana/grafana"

An image stream tag will be created called grafana:latest, which will track this image. This image will be deployed in the deployment config grafana. Port 3000/tcp will be load-balanced by the grafana service.

  1. Other containers can access this service through the grafana host name:
--> Creating resources ...

imagestream.image.openshift.io "grafana" created

deploymentconfig.apps.openshift.io "grafana" created

service "grafana" created

--> Success
  1. You can expose this service by executing the following command:
'oc expose svc/grafana'
  1. Run oc status to view your app. This will expose it, as follows:
./oc expose service grafana

route.route.openshift.io/grafana exposed

  1. Now open your browser and point it to the route that's displayed in the Web console.

By default, Grafana is secured, and you can log in by providing the username and password for admin.

  1. Next, you will be prompted to change the default password. Set it to be anything of your choice.
  2. Next, Grafana asks you to set a data source, as depicted in the following screenshot:

  1. Select the Prometheus Data Sources:

  1. Add the following settings:

  1. For the URL, you should set the Prometheus service name, not the route. Save & Test the settings, and then click Back.
  2. Select the Prometheus box and then select the Dashboards tab, as shown in the following screenshot:

  1. Import all the available statistics:

  1. By clicking on Prometheus 2.0 Stats, you should now see a better monitoring interface:

The monitoring interface data on Prometheus 2.0 Stat

This is definitely a better look and feel than the one that's provided by Prometheus. In addition, Grafana provides a series of plugins that you can use for your graphs through its website.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset