Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ncabatoff/grafana-hashiprov
Deploy Grafana for Prometheus using Terraform, Nomad, and Consul
https://github.com/ncabatoff/grafana-hashiprov
Last synced: about 1 month ago
JSON representation
Deploy Grafana for Prometheus using Terraform, Nomad, and Consul
- Host: GitHub
- URL: https://github.com/ncabatoff/grafana-hashiprov
- Owner: ncabatoff
- License: mit
- Created: 2019-04-01T21:42:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-07T20:57:33.000Z (12 months ago)
- Last Synced: 2024-10-15T13:30:01.571Z (3 months ago)
- Language: HCL
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grafana-hashiprov: Provision static Grafana using HashiCorp tools.
This repo solves the problem of how to deploy Grafana and configure it with
datasources and dashboards, where:* the datasources are Prometheus servers registered in Consul
* you want Grafana to run as a Nomad job
* you have Consul DNS available in your environment
* you want to store your dashboards in a Git repoNeither the datasources nor dashboards will be modifiable via the Grafana UI.
This is a feature.## Usage
Put your dashboards into a repo, e.g. https://github.com/ncabatoff/grafana-dashboards.
```bash
terraform init
terraform apply
```When you want to update the dashboards, repeat the above. The existing Grafana
job will be stopped and a new one created with the updated provisioning.## Caveats
### 1. Nomad Provider
This relies on the Terraform
[Nomad Provider](https://www.terraform.io/docs/providers/nomad/index.html).
This may not suit your production needs due to
[Issue #1](https://github.com/terraform-providers/terraform-provider-nomad/issues/1):
if changes are made to the Nomad job outside of Terraform, Terraform won't know.Workaround if you ever get into a bad state:
* stop the Nomad job, then
* ```terraform destroy -target=nomad_job.grafana```
* ```terraform apply```