Skip to content

Instantly share code, notes, and snippets.

@making
Last active November 1, 2021 08:54
Show Gist options
  • Save making/037c5088a29c8dd8c46e11385bc6c69a to your computer and use it in GitHub Desktop.
Save making/037c5088a29c8dd8c46e11385bc6c69a to your computer and use it in GitHub Desktop.
#@ load("@ytt:sha256", "sha256")
#@ load("@ytt:data", "data")
---
version: "3"
services:
monitoring-config:
image: hairyhenderson/gomplate:v3.10.0-alpine
container_name: monitoring-config
entrypoint: ["/bin/sh","-c"]
command:
- gomplate -i '{{ tmpl.Inline .Env.CONFIG }}' -o /etc/prometheus/prometheus.yml
environment:
CONFIG: #@ data.read("prometheus.yml")
volumes:
- /docker/docker-data/prometheus/conf:/etc/prometheus
prometheus:
image: prom/prometheus:latest
container_name: prometheus
depends_on:
- monitoring-config
volumes:
- /docker/docker-data/prometheus/conf:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
labels:
checkusum: #@ sha256.sum(data.read("prometheus.yml"))
restart: unless-stopped
#@data/values
---
global:
scrape_interval: 15s
evaluation_interval: 15s
alerting:
alertmanagers:
- static_configs:
- targets:
- alertmanager:9093
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['prometheus:9090']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment