Promtail: use local task dir rather than bind mount

This commit is contained in:
IamTheFij 2023-05-12 10:11:30 -07:00
parent d4cb91d58d
commit 1df5545835

View File

@ -39,16 +39,9 @@ job "exporters" {
config { config {
image = "grafana/promtail:2.7.1" image = "grafana/promtail:2.7.1"
args = ["-config.file=/etc/promtail/promtail.yml"] args = ["-config.file=${NOMAD_TASK_DIR}/promtail.yml"]
ports = ["promtail"] ports = ["promtail"]
# Mount config
mount {
type = "bind"
target = "/etc/promtail/promtail.yml"
source = "local/promtail.yml"
}
# Bind mount host machine-id and log directories # Bind mount host machine-id and log directories
mount { mount {
@ -134,7 +127,7 @@ scrape_configs:
- source_labels: ['__journal_com_hashicorp_nomad_task_name'] - source_labels: ['__journal_com_hashicorp_nomad_task_name']
target_label: nomad_task_name target_label: nomad_task_name
EOF EOF
destination = "local/promtail.yml" destination = "${NOMAD_TASK_DIR}/promtail.yml"
} }
resources { resources {