Block metrics from Traefik, small cleanup

This commit is contained in:
Daniel Berteaud 2024-03-26 10:54:24 +01:00
parent 1337ef7caf
commit 8ca4189c93
4 changed files with 20 additions and 2 deletions

View File

@ -4,6 +4,12 @@ Sources = [
{
Name = "[[ (merge .miniflux .).traefik.instance ]][[ .consul.suffix ]]"
Permissions = [
{
Action = "deny"
HTTP {
PathPrefix = "/metrics"
}
},
{
Action = "allow"
HTTP {

View File

@ -4,6 +4,12 @@ Sources = [
{
Name = "traefik"
Permissions = [
{
Action = "deny"
HTTP {
PathPrefix = "/metrics"
}
},
{
Action = "allow"
HTTP {

View File

@ -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

View File

@ -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 {