diff --git a/2024/12/grafana_demo1/README.md b/2024/12/grafana_demo1/README.md new file mode 100644 index 0000000..7229887 --- /dev/null +++ b/2024/12/grafana_demo1/README.md @@ -0,0 +1,13 @@ +# Setup + +``` +docker compose -f ./setup.yaml up -d +docker container exec grafana_demo1-grafana-1 "/bin/bash" "-c" "mkdir -p /etc/grafana/provisioning/datasources" +docker container cp datasources.yaml grafana_demo1-grafana-1:/etc/grafana/provisioning/datasources/prometheus.yaml +docker compose -f ./setup.yaml down +``` +# Actual running + +``` +docker compose -f ./app.yaml -d +``` diff --git a/2024/12/graphana_demo1/app.yaml b/2024/12/grafana_demo1/app.yaml similarity index 83% rename from 2024/12/graphana_demo1/app.yaml rename to 2024/12/grafana_demo1/app.yaml index 87a8ad9..32799c7 100644 --- a/2024/12/graphana_demo1/app.yaml +++ b/2024/12/grafana_demo1/app.yaml @@ -15,6 +15,7 @@ services: - '3000:3000' volumes: - 'grafana-storage:/var/lib/grafana' + - 'grafana-provisioning:/etc/grafana/provisioning' networks: - net @@ -23,6 +24,7 @@ networks: driver: bridge volumes: + grafana-provisioning: grafana-storage: prometheus-data: diff --git a/2024/12/grafana_demo1/datasources.yaml b/2024/12/grafana_demo1/datasources.yaml new file mode 100644 index 0000000..d6e2d38 --- /dev/null +++ b/2024/12/grafana_demo1/datasources.yaml @@ -0,0 +1,12 @@ +apiVersion: 1 + +deleteDatasources: + +datasources: + - name: prometheus + type: prometheus + url: http://prometheus:9090/ + isDefault: true + jsonData: + sslMode: "disable" + version: 2 diff --git a/2024/12/grafana_demo1/setup.yaml b/2024/12/grafana_demo1/setup.yaml new file mode 100644 index 0000000..998aec0 --- /dev/null +++ b/2024/12/grafana_demo1/setup.yaml @@ -0,0 +1,18 @@ +version: '3.7' +services: + prometheus: + image: 'nginx' + volumes: + - 'prometheus-data:/prometheus' + + grafana: + image: 'nginx' + volumes: + - 'grafana-storage:/var/lib/grafana' + - 'grafana-provisioning:/etc/grafana/provisioning' + +volumes: + grafana-provisioning: + grafana-storage: + prometheus-data: +