Git Product home page Git Product logo

grafana-ocp's Introduction

grafana-ocp

This project introduce a grafana deployment for openshift metrics.

Note: make sure to have openshift prometheus deployed.

To deploy grafana

Note: make sure to have openshift prometheus deployed. (https://github.com/openshift/origin/tree/master/examples/prometheus)

./setup-grafana.sh prometheus-ocp prometheus false - for byo cluster (prometheus selfdeployment).

./setup-grafana.sh prometheus-ocp openshift-metrics true - for byo cluster that uses openshift_metrics plus oauth.

How to use oauth proxy:

Note: when using oauth make sure your user has permission to browse grafana.

  • add a openshift user htpasswd htpasswd -c /etc/origin/master/htpasswd gfadmin
  • use the HTPasswdPasswordIdentityProvider as described here - https://docs.openshift.com/enterprise/3.0/admin_guide/configuring_authentication.html
  • make sure point the provider file to /etc/origin/master/htpasswd. or using this example cmd:
    sed -ie 's|AllowAllPasswordIdentityProvider|HTPasswdPasswordIdentityProvider\n      file: /etc/origin/master/htpasswd|' /etc/origin/master/master-config.yaml
    
  • add view role to user oc adm policy add-cluster-role-to-user cluster-reader gfadmin
  • restart master api systemctl restart atomic-openshift-master-api.service
  • get the grafana url by oc get route
  • discover your openshift dashboard.

Deploy on openshift cluster with grafana manually

(https://github.com/openshift/origin/tree/master/examples/prometheus)

  1. oc create project grafana
  2. oc new-app -f grafana-ocp.yaml
  3. oc expose svc grafana-ocp
  4. grab the grafana url oc get route |awk 'NR==2 {print $2}'
  5. grab the ocp token, from openshift master run: oc sa get-token management-admin -n management-infra
  6. browse to grafana via browser and add new prometheus DS to grafana.
  7. paste the token string at the token field.
  8. checkout the TLS checkbox.
  9. save & test and make sure all green.

Pull standalone docker grafana instance

  1. docker pull docker.io/mrsiano/grafana-ocp
  2. docker run -d -ti -p 3000:3000 mrsiano/grafana-ocp "./bin/grafana-server"

Build and run the docker image

  1. docker build -t grafana-ocp .
  2. docker run -d -ti -p 3000:3000 grafana-ocp "./bin/grafana-server"

Resources

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.