From 8ca4189c93e49a54df1cd69b8b0489c256c960fe Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 26 Mar 2024 10:54:24 +0100 Subject: [PATCH] Block metrics from Traefik, small cleanup --- consul/config/service-intentions/miniflux.hcl | 6 ++++++ example/consul/config/service-intentions/miniflux.hcl | 6 ++++++ example/miniflux.nomad.hcl | 8 +++++++- miniflux.nomad.hcl | 2 +- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/consul/config/service-intentions/miniflux.hcl b/consul/config/service-intentions/miniflux.hcl index 3cd3426..e1eee4b 100644 --- a/consul/config/service-intentions/miniflux.hcl +++ b/consul/config/service-intentions/miniflux.hcl @@ -4,6 +4,12 @@ Sources = [ { Name = "[[ (merge .miniflux .).traefik.instance ]][[ .consul.suffix ]]" Permissions = [ + { + Action = "deny" + HTTP { + PathPrefix = "/metrics" + } + }, { Action = "allow" HTTP { diff --git a/example/consul/config/service-intentions/miniflux.hcl b/example/consul/config/service-intentions/miniflux.hcl index 28b6361..2c244e7 100644 --- a/example/consul/config/service-intentions/miniflux.hcl +++ b/example/consul/config/service-intentions/miniflux.hcl @@ -4,6 +4,12 @@ Sources = [ { Name = "traefik" Permissions = [ + { + Action = "deny" + HTTP { + PathPrefix = "/metrics" + } + }, { Action = "allow" HTTP { diff --git a/example/miniflux.nomad.hcl b/example/miniflux.nomad.hcl index ca490c1..a8ee37e 100644 --- a/example/miniflux.nomad.hcl +++ b/example/miniflux.nomad.hcl @@ -21,7 +21,11 @@ job "miniflux" { name = "miniflux" port = 8085 - + meta { + alloc = "${NOMAD_ALLOC_INDEX}" + job = "${NOMAD_JOB_NAME}" + namespace = "${NOMAD_NAMESPACE}" + } connect { sidecar_service { @@ -146,6 +150,8 @@ _EOT env = true } + + # Use a template block instead of env {} so we can fetch values from vault template { data = <<_EOT diff --git a/miniflux.nomad.hcl b/miniflux.nomad.hcl index ad718ad..d047b82 100644 --- a/miniflux.nomad.hcl +++ b/miniflux.nomad.hcl @@ -23,7 +23,7 @@ job "[[ .instance ]]" { name = "[[ .instance ]][[ .consul.suffix ]]" port = 8085 -[[ template "common/prometheus_meta" $c ]] +[[ template "common/service_meta" $c ]] [[ template "common/connect" $c ]] check {