homelab/nomad-job/crowdsec-api.nomad

68 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-05-26 12:19:32 +00:00
job "crowdsec-api" {
datacenters = ["homelab"]
priority = 50
2022-10-29 08:40:01 +00:00
type = "service"
2022-05-26 12:19:32 +00:00
meta {
forcedeploy = "-1"
}
2024-02-21 18:03:31 +00:00
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
2022-10-29 08:40:01 +00:00
vault {
2022-10-30 08:33:39 +00:00
policies = ["crowdsec"]
2022-05-26 12:19:32 +00:00
}
2024-02-21 18:03:31 +00:00
2022-05-26 12:19:32 +00:00
group "crowdsec-api" {
network {
mode = "host"
port "http" {
2022-05-26 16:24:51 +00:00
static = 8898
2022-10-29 08:40:01 +00:00
to = 8080
2022-05-26 12:19:32 +00:00
}
2022-10-29 08:40:01 +00:00
port "metric" {
2022-05-26 12:19:32 +00:00
to = 6060
}
}
task "crowdsec-api" {
2022-10-29 08:40:01 +00:00
service {
name = "crowdsec-metrics"
2022-05-26 12:19:32 +00:00
port = "metric"
tags = [
]
}
2022-10-29 08:40:01 +00:00
driver = "docker"
2022-05-26 12:19:32 +00:00
service {
2022-10-29 08:40:01 +00:00
name = "crowdsec-api"
2022-05-26 12:19:32 +00:00
port = "http"
tags = [
]
}
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/crowdsecurity/crowdsec"
2022-10-29 08:40:01 +00:00
ports = ["http", "metric"]
2022-05-26 12:19:32 +00:00
volumes = [
"/mnt/diskstation/nomad/crowdsec/db:/var/lib/crowdsec/data",
2024-01-27 08:33:42 +00:00
"/mnt/diskstation/nomad/crowdsec/data:/etc/crowdsec",
2022-05-26 12:19:32 +00:00
]
}
template {
2022-10-29 08:40:01 +00:00
data = <<EOH
2022-05-26 12:19:32 +00:00
DISABLE_AGENT = "true"
EOH
2022-10-29 08:40:01 +00:00
destination = "secret/api.env"
env = "true"
2022-05-26 12:19:32 +00:00
}
resources {
memory = 99
}
}
2022-10-29 08:40:01 +00:00
2022-05-26 12:19:32 +00:00
}
}