2022-02-27 22:49:00 +00:00
|
|
|
variable "count" {
|
|
|
|
type = number
|
|
|
|
default = 2
|
|
|
|
}
|
|
|
|
|
2022-02-16 17:56:18 +00:00
|
|
|
job "whoami" {
|
|
|
|
region = "global"
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
|
|
|
|
type = "service"
|
|
|
|
|
|
|
|
group "whoami" {
|
2022-02-27 22:49:00 +00:00
|
|
|
count = var.count
|
|
|
|
|
2022-02-16 17:56:18 +00:00
|
|
|
network {
|
|
|
|
mode = "bridge"
|
|
|
|
port "web" {
|
2023-03-24 23:32:37 +00:00
|
|
|
host_network = "wesher"
|
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",
|
2022-03-15 19:02:55 +00:00
|
|
|
"traefik.http.routers.whoami.entryPoints=websecure",
|
2022-11-15 19:43:05 +00: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 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}"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
2022-07-25 22:51:16 +00:00
|
|
|
memory = 20
|
2022-02-16 17:56:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|