GithubHelp home page GithubHelp logo

selvan123 / prometheus-openshift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simonmeggle/prometheus-openshift

0.0 1.0 0.0 151 KB

Prometheus monitoring node-exporter, kubernetes-API, kube-state-metrics, HAProxy, kubediff

prometheus-openshift's Introduction

Monitoring OpenShift with Prometheus, Node-Exporter, Kube-State-Metrics / visualization by Grafana

Version overview

This project was build upon the following components:

  • OpenShift 3.7.1
  • Prometheus 2.1.0
  • Grafana 5.0.0-beta4
  • Kube-state-metrics 1.1.0
  • Node-Exporter 0.15.2

Testing on minishift

minishift start --memory 8GB --openshift-version v3.7.1

Grant permissions for developer to see everything in minishift's console

oc adm policy add-cluster-role-to-user cluster-admin developer

Deployment steps

Firewall

see https://github.com/wkulhanek/openshift-prometheus/tree/master/node-exporter

Deploy base components

Because we set some cluster-reader role-bindings, we need to login as a cluster-admin:

oc login -u system:admin

In the next step we instantiate the project, in this case "monitoring".

oc new-project monitoring

Next we import readymade Grafana-dashboards into a ConfigMap:

oc create configmap dashboards-grafana --from-file=dashboards/

In the next step we create the monitoring components based on a template:

oc new-app -p NAMESPACE=monitoring -f monitoring-template.yaml

Alternative command:

oc process -p NAMESPACE=monitoring -f monitoring-template.yaml | oc apply -f -

After this step, you'll have Prometheus, Grafana and kube-state-metrics running.

Deploy node-exporter

The optional node-exporter component may be installed as a daemon set to gather host level metrics. It requires additional privileges to view the host and should only be run in administrator controlled namespaces.

Optional: ignore the project limits

Without deleteing or changing the limits, sometimes not all nodes can be scheduled.

# oc export limits default-limits -o yaml > default_limits.yaml
oc delete limitrange default-limits
# oc export quota default-quota -o yaml > deault_quota.yaml
oc delete quota default-quota

Ignore the default node selector so that node-exporters can run on every node

oc annotate ns monitoring openshift.io/node-selector= --overwrite

Deploy node-exporter DaemonSet

oc create -f node-exporter.yaml

Allow privileged execution of node-exporter

oc adm policy add-scc-to-user -z prometheus-node-exporter -n monitoring hostaccess

WUI access

Get the routes to open Grafana and Prometheus in the browser:

oc get route
NAME         HOST/PORT                                   PATH      SERVICES     PORT      TERMINATION   WILDCARD
grafana      grafana-monitoring.192.168.64.5.nip.io                grafana      3000                    None
prometheus   prometheus-monitoring.192.168.64.5.nip.io             prometheus   9090                    None

Grafana default login credentials:

  • root
  • secret

Notes:

# show events sorted
oc get events --sort-by='.lastTimestamp'
# show cluster wide objects
oc get ds --all-namespaces
# wide output
oc get pods -o wide
# poor man's oc dashboard
watch -n 1 "echo '###pods';oc get pods; echo '###dc'; oc get dc; echo '###ds'; oc get ds; echo '###svc'; oc get svc; echo '###configmap'; oc get configmap; echo '###routes'; oc get routes"
# access minishift pv's
minishift ssh
sudo su -
cd /var/lib/minishift/openshift.local.pv

FIXME

  • k-s-m does not seem to export deployment metrics on openshift
  • k-s-m does not provide kube_resourcequota used in dashboard "Cluster overview"
  • check rule evaluation and its graph on the prometheus dashboard

TODO

prometheus-openshift's People

Contributors

m-kraus avatar

Watchers

James Cloos 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.