homelab-nomad/services/whoami.nomad

60 lines
1.1 KiB
Plaintext
Raw Normal View History

variable "count" {
type = number
default = 2
}
2022-02-16 17:56:18 +00:00
job "whoami" {
region = "global"
datacenters = ["dc1"]
type = "service"
group "whoami" {
count = var.count
2022-02-16 17:56:18 +00:00
network {
mode = "bridge"
port "web" {
%{~ if use_wesher ~}
host_network = "wesher"
%{~ endif ~}
2022-02-17 22:03:42 +00:00
to = 80
2022-02-16 17:56:18 +00:00
}
}
service {
2022-03-13 17:13:19 +00:00
name = "whoami"
2023-03-24 18:24:36 +00:00
provider = "nomad"
2022-02-16 17:56:18 +00:00
port = "web"
tags = [
"traefik.enable=true",
"traefik.http.routers.whoami.entryPoints=websecure",
# "traefik.http.routers.whoami.middlewares=basic-auth@file",
"traefik.http.routers.whoami.middlewares=authelia@nomad",
# "traefik.http.routers.whoami.middlewares=authelia-basic@consulcatalog",
# "traefik.http.routers.whoami.middlewares=authelia@file",
2022-02-16 17:56:18 +00:00
]
}
task "whoami" {
driver = "docker"
2023-01-12 20:11:16 +00:00
meta = {
"diun.enable" = false
}
2022-02-16 17:56:18 +00:00
config {
image = "containous/whoami:latest"
ports = ["web"]
args = ["--port", "$${NOMAD_PORT_web}"]
2022-02-16 17:56:18 +00:00
}
resources {
cpu = 50
2022-07-25 22:51:16 +00:00
memory = 20
2022-02-16 17:56:18 +00:00
}
}
}
}