Nomploy Nomad Packs

← All packs

grafana v0.1.0

Observability

Grafana — the open observability platform for dashboards and visualization, deployed as a host-networked Nomad service with a persistent Docker volume for its database and plugins.

nomad-pack run grafana --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- grafana

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 3001 1 volume image grafana/grafana:latest tracks :latest image bumped 1 mo ago
Variables 12
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run grafana -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "grafana"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Grafana container image.
image = "grafana/grafana:latest"

# Host port Grafana listens on (host networking). Default 3001 to avoid clashing with the nomploy panel on :3000. Pick a free port on the target node.
port = 3001

# Number of instances (keep at 1 — the default SQLite DB is local-disk).
count = 1

# Initial admin username.
admin_user = "admin"

# Initial admin password. CHANGE THIS — it is baked into the job env.
admin_password = "admin"

# Public URL Grafana believes it is served at (set when fronting it with a domain, e.g. https://grafana.example.com). Empty = use the host:port.
root_url = ""

# Docker named volume for /var/lib/grafana (SQLite DB, plugins). A fresh volume inherits the image's dir ownership (uid 472), so Grafana can write it.
data_volume = "grafana_data"

# Placement constraints — e.g. pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 500
    memory = 512
  }
NameTypeDefaultDescription
job_name string
"grafana"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"grafana/grafana:latest"
The Grafana container image.
port number
3001
Host port Grafana listens on (host networking). Default 3001 to avoid clashing with the nomploy panel on :3000. Pick a free port on the target node.
count number
1
Number of instances (keep at 1 — the default SQLite DB is local-disk).
admin_user string
"admin"
Initial admin username.
admin_password key string
"admin"
Initial admin password. CHANGE THIS — it is baked into the job env.
root_url string
""
Public URL Grafana believes it is served at (set when fronting it with a domain, e.g. https://grafana.example.com). Empty = use the host:port.
data_volume string
"grafana_data"
Docker named volume for /var/lib/grafana (SQLite DB, plugins). A fresh volume inherits the image's dir ownership (uid 472), so Grafana can write it.
constraints list
[]
Placement constraints — e.g. pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 512
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: grafana_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/grafana_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/grafana_data/_data backup:<bucket>/grafana_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

grafana

Grafana as a host-networked Nomad service with a persistent Docker named volume for its SQLite database and plugins.

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run grafana --registry nomploy --var admin_password=change-me

Or in nomploy: Create → Nomad Pack, pick grafana from the Nomploy registry.

Variables

Variable Default Description
job_name grafana Nomad job name
image grafana/grafana:latest Container image
port 3001 Host port (avoids the panel's :3000)
count 1 Keep at 1 (local SQLite DB)
admin_user admin Initial admin user
admin_password admin Change this
root_url "" Public URL when fronted by a domain
data_volume grafana_data Docker named volume for /var/lib/grafana
constraints [] Pin placement so the local volume stays put
resources {cpu=500, memory=512} Task resources

Notes