Add prom ports to nextcloud backup

This commit is contained in:
IamTheFij 2022-05-09 21:44:26 -07:00
parent 2ed2079b45
commit 3b8f9734ac
2 changed files with 16 additions and 4 deletions

View File

@ -132,10 +132,6 @@ scrape_configs:
metrics_path: "/metrics" metrics_path: "/metrics"
consul_sd_configs: consul_sd_configs:
- server: "${var.consul_address}" - server: "${var.consul_address}"
services:
- "cadvisor"
- "nodeexporter"
- "blocky-api"
relabel_configs: relabel_configs:
- source_labels: [__meta_consul_service_metadata_metrics_addr] - source_labels: [__meta_consul_service_metadata_metrics_addr]
action: keep action: keep

View File

@ -27,10 +27,15 @@ job "nextcloud" {
network { network {
mode = "bridge" mode = "bridge"
port "web" { port "web" {
host_network = "loopback" host_network = "loopback"
to = 80 to = 80
} }
port "backup" {
to = 8080
}
} }
volume "nextcloud-data" { volume "nextcloud-data" {
@ -138,6 +143,16 @@ job "nextcloud" {
} }
} }
service {
name = "nextcloud-backups"
port = "backup"
meta {
metrics_addr = "${NOMAD_ADDR_backup}"
}
}
# TODO: Add service and expose /metrics for prometheus to grab
task "backup" { task "backup" {
driver = "docker" driver = "docker"
@ -150,6 +165,7 @@ job "nextcloud" {
config { config {
image = "iamthefij/resticscheduler" image = "iamthefij/resticscheduler"
args = ["/jobs/nextcloud.hcl"] args = ["/jobs/nextcloud.hcl"]
ports = ["backup"]
mount { mount {
type = "bind" type = "bind"