2022-02-27 14:49:00 -08:00
|
|
|
variable "count" {
|
|
|
|
type = number
|
|
|
|
default = 2
|
|
|
|
}
|
|
|
|
|
2022-02-16 09:56:18 -08:00
|
|
|
job "whoami" {
|
|
|
|
region = "global"
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "whoami" {
|
2022-02-27 14:49:00 -08:00
|
|
|
count = var.count
|
|
|
|
|
2022-02-16 09:56:18 -08:00
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
port "web" {
|
2023-03-24 16:32:37 -07:00
|
|
|
host_network = "wesher"
|
2022-02-17 14:03:42 -08:00
|
|
|
to = 80
|
2022-02-16 09:56:18 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
2022-03-13 10:13:19 -07:00
|
|
|
name = "whoami"
|
2023-03-24 11:24:36 -07:00
|
|
|
provider = "nomad"
|
2022-02-16 09:56:18 -08:00
|
|
|
port = "web"
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"traefik.enable=true",
|
2022-03-15 12:02:55 -07:00
|
|
|
"traefik.http.routers.whoami.entryPoints=websecure",
|
2022-11-15 11:43:05 -08:00
|
|
|
# "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 09:56:18 -08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
task "whoami" {
|
|
|
|
driver = "docker"
|
|
|
|
|
2023-01-12 12:11:16 -08:00
|
|
|
meta = {
|
|
|
|
"diun.enable" = false
|
|
|
|
}
|
|
|
|
|
2022-02-16 09:56:18 -08:00
|
|
|
config {
|
|
|
|
image = "containous/whoami:latest"
|
|
|
|
ports = ["web"]
|
|
|
|
args = ["--port", "${NOMAD_PORT_web}"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
2022-07-25 15:51:16 -07:00
|
|
|
memory = 20
|
2022-02-16 09:56:18 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|