Skip to content

Commit

Permalink
added grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
davetayl committed Apr 24, 2023
1 parent 3cfb1bc commit 7b09ddc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# vagrant_k0s_build
This is a basic prometheus build
# Vagrant(Prometheus with Grafana)
This is a basic prometheus build with node exporter and grafana for testing and education.

## Usage
- Set up a <a href="https://www.vagrantup.com/">Vagrant</a> environment with <a href="https://www.virtualbox.org/">virtualbox</a> as the virtualisation provider.
- Clone the repo using ```git clone <repo url>```
- cd to the repo directory and run ```vagrant up```
- Then to access the CLI run ```vagrant ssh prometheus```
- Then to access the prometheus host CLI run ```vagrant ssh prometheus```
- Then to access the grafana host CLI run ```vagrant ssh grafana```
- The prometheus web UI can be accessed at http://localhost:9090
- The Grafana web UI can be accessed at http://localhost
13 changes: 13 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,21 @@ Vagrant.configure("2") do |config|
vb.cpus = 2
end
prometheus.vm.hostname = "prometheus"
prometheus.vm.network "forward_port", guest: 9090, host: 9090
prometheus.vm.network "private_network", ip: "10.0.0.16", netmask:"255.255.255.0"
prometheus.vm.provision "shell", path: "./debian11-setup.sh"
prometheus.vm.provision "shell", path: "./provision-prometheus.sh"
end
config.vm.define "grafana" do |grafana|
grafana.vm.box = "debian/bullseye64"
grafana.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 2
end
grafana.vm.hostname = "grafana"
grafana.vm.network "forward_port", guest: 3000, host: 80
grafana.vm.network "private_network", ip: "10.0.0.17", netmask:"255.255.255.0"
grafana.vm.provision "shell", path: "./debian11-setup.sh"
grafana.vm.provision "shell", path: "./provision-grafana.sh"
end
end
9 changes: 9 additions & 0 deletions provision-grafana.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Install the grafana application
apt-get -y install adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana_9.4.7_amd64.deb
apt -y install ./grafana_9.4.7_amd64.deb

# Enable and start grafana
systemctl enable --now grafana

# Configure Grafana for use with Prometheus

0 comments on commit 7b09ddc

Please sign in to comment.