feat: add constrainst to limit nas job

This commit is contained in:
vincent 2024-02-21 19:03:31 +01:00
parent c4d10aacfe
commit e470b204a5
21 changed files with 107 additions and 12 deletions

View File

@ -8,6 +8,11 @@ job "alertmanager" {
vault { vault {
policies = ["alertmanager"] policies = ["alertmanager"]
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "alertmanager" { group "alertmanager" {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "batch-seedboxsync" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
constraint { constraint {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"

View File

@ -5,9 +5,15 @@ job "crowdsec-api" {
meta { meta {
forcedeploy = "-1" forcedeploy = "-1"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
vault { vault {
policies = ["crowdsec"] policies = ["crowdsec"]
} }
group "crowdsec-api" { group "crowdsec-api" {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "dashboard" {
meta { meta {
forcedeploy = "1" forcedeploy = "1"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "dashboard" { group "dashboard" {
network { network {
mode = "host" mode = "host"

View File

@ -9,7 +9,11 @@ job "dockermailserver" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "dockermailserver" { group "dockermailserver" {
network { network {
mode = "host" mode = "host"

View File

@ -10,7 +10,11 @@ job "filestash" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "filestash" { group "filestash" {
network { network {

View File

@ -9,6 +9,11 @@ job "git" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "gitea" { group "gitea" {
network { network {
mode = "host" mode = "host"

View File

@ -2,6 +2,11 @@ job "grafana" {
datacenters = ["homelab"] datacenters = ["homelab"]
priority = 50 priority = 50
type = "service" type = "service"
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
meta { meta {
forcedeploiement = 2 forcedeploiement = 2
} }

View File

@ -3,6 +3,11 @@ job "homeassistant" {
datacenters = ["homelab"] datacenters = ["homelab"]
priority = 90 priority = 90
type = "service" type = "service"
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }

View File

@ -2,6 +2,7 @@ job "jellyfin" {
datacenters = ["homelab"] datacenters = ["homelab"]
priority = 30 priority = 30
type = "service" type = "service"
meta { meta {
forcedeploy = "1" forcedeploy = "1"
} }
@ -9,6 +10,11 @@ job "jellyfin" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group jellyfin-vue { group jellyfin-vue {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "loki" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "loki" { group "loki" {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "pacoloco" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "pacoloco" { group "pacoloco" {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "paperless-ng" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
constraint { constraint {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"

View File

@ -10,6 +10,11 @@ job "pdns-auth" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "pdns-auth" { group "pdns-auth" {
network { network {
port "dns" { port "dns" {

View File

@ -9,6 +9,11 @@ job "pihole" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "pi-hole" { group "pi-hole" {
network { network {
port "dns" { port "dns" {

View File

@ -9,7 +9,11 @@ job "prometheus" {
meta{ meta{
force_deploy= 1 force_deploy= 1
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "prometheus" { group "prometheus" {
count = 1 count = 1

View File

@ -6,6 +6,11 @@ job "radicale" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "radicale" { group "radicale" {
network { network {
mode = "host" mode = "host"

View File

@ -10,7 +10,11 @@ job "supysonic" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "supysonic" { group "supysonic" {
network { network {
mode = "host" mode = "host"

View File

@ -10,7 +10,11 @@ job "syncthing" {
attribute = "${attr.cpu.arch}" attribute = "${attr.cpu.arch}"
value = "amd64" value = "amd64"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "syncthing" { group "syncthing" {
network { network {

View File

@ -2,7 +2,11 @@ job "traefik-local" {
datacenters = ["homelab"] datacenters = ["homelab"]
priority = 90 priority = 90
type = "service" type = "service"
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "traefik-local" { group "traefik-local" {
network { network {
mode = "host" mode = "host"

View File

@ -6,7 +6,11 @@ job "vaultwarden" {
meta { meta {
forcedeploy = "0" forcedeploy = "0"
} }
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
group "vaultwarden" { group "vaultwarden" {
network { network {
mode = "host" mode = "host"