Skip to content

monk-io/monk-prometheus-grafana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus & Grafana meets Monk

This repository contains Monk.io template to deploy Grafana & Prometheus system either locally or on cloud of your choice (AWS, GCP, Azure, Digital Ocean).

It includes simple Grafana dashboards and few basic variables that will allow you to quickly spin up instance and add custom dashboards.

Prerequisites

Make sure monkd is running.

foo@bar:~$ monk status
daemon: ready
auth: logged in
not connected to cluster

Clone Repository

git clone [email protected]:CuteAnonymousPanda/monk-prometheus-grafana.git

Load Template

cd monk-prometheus-grafana
monk load manifest.yaml

Verify if it's loaded correctly

$ monk list -l monitoring

✔ Got the list
Type      Template                  Repository  Version  Tags
runnable  monitoring/grafana        local       -        -
runnable  monitoring/node-exporter  local       -        -
runnable  monitoring/prometheus     local       -        -
group     monitoring/stack          local       -        -

Deploy Stack

$ monk run monitoring/stack
✔ Starting the job: local/monitoring/stack... DONE
✔ Preparing nodes DONE
✔ Checking/pulling images...
✔ [================================================] 100% docker.io/prom/prometheus:latest QmfWqNH8oktNNqaujf7XGSCRDmy4vMkcwshjyt37SE76ns
✔ [================================================] 100% quay.io/prometheus/node-exporter:latest QmfWqNH8oktNNqaujf7XGSCRDmy4vMkcwshjyt37SE76ns
✔ [================================================] 100% docker.io/grafana/grafana:latest QmfWqNH8oktNNqaujf7XGSCRDmy4vMkcwshjyt37SE76ns
✔ Checking/pulling images DONE
✔ Starting containers DONE
✔ Starting containers DONE
✔ Starting containers DONE
✔ New container local-23d4982c498a4242c04f299306-cal-monitoring-grafana-grafana created DONE
✔ New container local-a4277f5d0c8e60b2c304992412--monitoring-node-exporter-node created DONE
✔ Started local/monitoring/stack

🔩 templates/local/monitoring/stack
 └─🧊 Peer QmfWqNH8oktNNqaujf7XGSCRDmy4vMkcwshjyt37SE76ns
    ├─🔩 templates/local/monitoring/prometheus
    │  └─📦 local-8c491fc7f285432c7828a04139-cal-monitoring-prometheus-prom
    │     ├─🧩 docker.io/prom/prometheus:latest
    │     └─🔌 open 192.168.0.197:9090 -> 9090
    ├─🔩 templates/local/monitoring/grafana
    │  └─📦 local-23d4982c498a4242c04f299306-cal-monitoring-grafana-grafana
    │     ├─🧩 docker.io/grafana/grafana:latest
    │     └─🔌 open 192.168.0.197:3000 -> 3000
    └─🔩 templates/local/monitoring/node-exporter
       └─📦 local-a4277f5d0c8e60b2c304992412--monitoring-node-exporter-node
          ├─🧩 quay.io/prometheus/node-exporter:latest
          ├─💾 / -> /host
          └─🔌 open 192.168.0.197:9100 -> 9100

💡 You can inspect and manage your above stack with these commands:
        monk logs (-f) local/monitoring/stack - Inspect logs
        monk shell     local/monitoring/stack - Connect to the container's shell
        monk do        local/monitoring/stack/action_name - Run defined action (if exists)
💡 Check monk help for more!

Variables

The variables are stored in manifest.yaml file. You can quickly setup by editing the values there.

Grafana

Variable Description Default
admin-user Administrator username admin
admin-password Administrator password admin
install_plugins Default plugins to install with grafana grafana-clock-panel,grafana-simple-json-datasource
anonymous Should we enable anonymous access false
anonymous_role Role of the anonymous user Viewer
prometheusHost Dynamic var to point to a Prometheus host <- connection-hostname("prometheus")
  • Only needs to be updated if using in your own namespace

Prometheus

Variable Description Default
cmdParams Additional params to pass to Prometheus cmdline
additional_targets Additional scrape targets for Prometheus*
  • In a format: '"another.lan:30303", "second.com:3333"'

Stop, remove and clean up workloads and templates

monk purge    monitoring/stack monitoring/grafana monitoring/prometheus monitoring/node-exporter
monk purge -x monitoring/stack monitoring/grafana monitoring/prometheus monitoring/node-exporter

Create your own template

You can create your own template and inherit the defaults and add more changes that are needed by you. This is an example manifest that you could adjust to your needs:

namespace: /myOwnMonitoring

grafana:
  defines: runnable
  inherits: monitoring/grafana
  variables:
    prometheusHost:
      type: string
      value: <- get-hostname("myOwnMonitoring/prometheus", "prom")

    admin-password:
      type: string
      value: testing123

prometheus:
  defines: runnable
  inherits: monitoring/prometheus
  variables:
    additional_targets:
      type: string
      value: '"testing1.com:3333"'

stack:
  defines: process-group
  runnable-list:
    - /myOwnMonitoring/grafana
    - /myOwnMonitoring/prometheus
    - /monitoring/node-exporter

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published