Created
December 12, 2020 19:43
-
-
Save picatz/1f315e012c6ab79565524032e1c64bc7 to your computer and use it in GitHub Desktop.
A simple Nomad job file to deploy Prometheus and Grafana
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "metrics" { | |
datacenters = ["dc1"] | |
group "prometheus" { | |
network { | |
mode = "bridge" | |
} | |
service { | |
name = "prometheus" | |
port = "9090" | |
connect { | |
sidecar_service {} | |
} | |
} | |
task "web" { | |
driver = "docker" | |
config { | |
image = "prom/prometheus:latest" | |
} | |
} | |
} | |
group "grafana" { | |
network { | |
mode ="bridge" | |
port "http" { | |
static = 3000 | |
to = 3000 | |
} | |
} | |
service { | |
name = "grafana" | |
port = "3000" | |
connect { | |
sidecar_service { | |
proxy { | |
upstreams { | |
destination_name = "prometheus" | |
local_bind_port = 9090 | |
} | |
} | |
} | |
} | |
} | |
task "dashboard" { | |
driver = "docker" | |
config { | |
image = "grafana/grafana:7.0.0" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment