Giter Site home page Giter Site logo

rook-grafana's Introduction

Rook grafana configuration

In order to configure grafana for Rook we have to configure two components Prometheus and Grafana. For Prometheus the user has to follow the instructions step by step. In this setup Grafana consumes ceph metrics provided by Prometheus to show nice dashboards to the user.

Grafana configuration

Assumptions

Before going on with the rest of this tutorial please make sure:

  1. You have a healthy ceph Rook cluster
  2. Prometheus is configured and running
  3. dashboard is configured with https (ssl: true)

First, let's clone this repository to get all the configuration files we will ned for the setup:

git clone https://github.com/rkachach/rook-grafana.git

Before going on with Grafana configuration please make sure Prometheus is up & running correctly in your Rook cluster. To get the URL where Prometheus is litening user can use (save its value as we will need it later):

echo "http://$(kubectl -n rook-ceph -o jsonpath={.status.hostIP} get pod prometheus-rook-prometheus-0):30900"

Grafana SSL certificate

In this guide we will be configuring Grafana to use https, therefore the first step is to generate the certificate the will be used by Grafana (just keep empty all the fields that openssl asks to introduce by hitting enter).

openssl req -newkey rsa:4096 -new -nodes -keyout grafana.key -x509 -days 365 -out grafana.crt
kubectl -n rook-ceph create secret tls grafana-tls --key grafana.key --cert grafana.crt

At the end of this process openssl should generate two files: grafana.crt and grafana.key

Store the generated files as k8s secrets:

kubectl -n rook-ceph create secret tls grafana-tls --key grafana.key --cert grafana.crt

Prepare Grafana configuration files

Before deploying grafana we have to set prometheus-service-ip:port in the configuration file grafana-datasource-config.yaml to Promtheus endpoint (got previously). At this point we should be ready to deploy Grafana by using the following command:

kubectl -n rook-ceph apply -f grafana-ini.yaml -f grafana-datasource-config.yaml -f deployment.yaml

The first file grafana-ini.yaml will be mapped to /etc/grafana/grafana.ini meanwhile the file grafana-datasource-config.yaml is mapped to /etc/grafana/provisioning/datasources/prometheus.yaml.

Create a service for Grafana deployment

kubectl -n rook-ceph apply -f  service.yaml

This command will create the service grafana as a NodePort listening on the port 32000. In case of minikube users grafana service url can be obtained by running:

minikube service grafana -n rook-ceph --url

Reset Grafana user/password

By default Grafana uses admin:<random_password> as credentials. For development environments it's handly to just set the password to admin (i.e). Following command will set Grafana's password to 'admin':

kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pods -l "app=grafana" -o jsonpath="{.items[0].metadata.name}") grafana-cli admin reset-admin-password admin

rook-grafana's People

Contributors

rkachach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.