Giter Site home page Giter Site logo

automation_night_demo's Introduction

Demo for Automation Night Aarhus (1. November 2016)

This is a demo that illustrates how Prometheus can be used to monitor a Kubernetes cluster. The demo is built by leveraging the awesome guide that CoreOS provides to setup a local Kubernetes cluster, along with there other guide to deploy Prometheus on the cluster to start monitoring.

Additions to the guide has been created to add Grafana, to show of the visualization of the metrics scrape by Prometheus.

To run: (make sure you have vagrant and kubectl installed)

$ cd coreos-kubernetes/multi-node/vagrant
$ vagrant up
$ export KUBECONFIG="${KUBECONFIG}:$(pwd)/kubeconfig"

$ kubectl config use-context vagrant-multi
$ kubectl config set-cluster vagrant-multi-cluster --server=https://172.17.4.101:443 --certificate-authority=${PWD}/ssl/ca.pem
$ kubectl config set-credentials vagrant-multi-admin --certificate-authority=${PWD}/ssl/ca.pem --client-key=${PWD}/ssl/admin-key.pem --client-certificate=${PWD}/ssl/admin.pem
$ kubectl config set-context vagrant-multi --cluster=vagrant-multi-cluster --user=vagrant-multi-admin
$ kubectl config use-context vagrant-multi

Once the kubernetes cluster is up and running. Verify with

$ kubectl get nodes

We can now deploy Prometheus and Grafana on the cluster as follows: (from the root of this repo)

$ ./prom_graf_up.sh

Shortly here after, you should be able to login:

Grafana: (grafana default user/password is admin/admin) http://172.17.4.101:30300/login

Prometheus: http://172.17.4.101:30900

Pushgateway: http://172.17.4.101:30901

To add dashboards in Grafana, first add Prometheus as a datasource, see the image:

Prometheus Datasource

Once Prometheus is installed as a datasource, add the dashboards by clicking on the dashboard menu, and choose "Import", next "Upload .json File", locate the file in the dashboard directory and press OK and Load.

If you would like to play around with the Kubernetes built-in dashboard, you can access it via a proxy:

kubectl proxy http://localhost:8001/ui

Prometheus Pushgateway

Simple example of how to push metrics to the pushgateway:

echo 'mysql_deleted_rows{label="somelabel"} 42' | curl --data-binary @- http://172.17.4.101:30901/metrics/job/cleanup/instance/database

When prometheus has scaped the gateway, your metric should be available.

automation_night_demo's People

Stargazers

Nat Welch avatar

Watchers

James Cloos avatar Kasper Borg Nissen 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.