Put dashboard behind traefik and enable metrics.

This commit is contained in:
2023-07-10 05:27:21 +01:00
parent c7b229ff8e
commit 74b0fa9627

View File

@@ -10,7 +10,7 @@ job "traefik" {
static = "443" static = "443"
} }
port "admin" { port "admin" {
#host_network = "tailscale" host_network = "tailscale"
static = "9002" static = "9002"
} }
} }
@@ -24,18 +24,28 @@ job "traefik" {
task "traefik" { task "traefik" {
driver = "docker" driver = "docker"
service { service {
name = "traefik-secure" name = "traefik"
port = "https" port = "https"
tags = [
"traefik.enable=true",
"traefik.http.routers.api.rule=Host(`traefik.v.paler.net`)",
"traefik.http.routers.api.service=api@internal",
]
check { check {
type = "tcp" type = "http"
port = "admin"
path = "/ping"
interval = "10s" interval = "10s"
timeout = "2s" timeout = "2s"
} }
} }
service { service {
name = "traefik" name = "traefik-admin"
port = "admin" port = "admin"
tags = [ tags = [
"metrics" "metrics"
@@ -71,18 +81,27 @@ entryPoints:
scheme: https scheme: https
permanent: true permanent: true
traefik:
address: ":{{{ env "NOMAD_PORT_admin" }}}"
websecure: websecure:
address: ":{{{ env "NOMAD_PORT_https" }}}" address: ":{{{ env "NOMAD_PORT_https" }}}"
http: http:
tls: tls:
certResolver: letsencrypt certResolver: letsencrypt
admin:
address: ":{{{ env "NOMAD_PORT_admin" }}}"
api: api:
dashboard: true dashboard: true
insecure: true
accessLog: {}
metrics:
prometheus:
entryPoint: admin
manualrouting: true
ping:
entryPoint: admin
serversTransport: serversTransport:
insecureSkipVerify: true insecureSkipVerify: true