orchestration-tests/nomad/mysql/adminer.nomad

70 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-02-16 17:56:18 +00:00
job "adminer" {
datacenters = ["dc1"]
type = "service"
group "adminer" {
count = 1
# Some affinity to stateful hosts?
network {
mode = "bridge"
port "adminer" {
2022-02-17 22:03:42 +00:00
host_network = "loopback"
2022-02-16 17:56:18 +00:00
to = 8080
}
}
service {
2022-03-14 22:58:03 +00:00
name = "adminer"
2022-02-16 17:56:18 +00:00
port = "adminer"
connect {
sidecar_service {
proxy {
2022-02-17 22:03:42 +00:00
local_service_port = 8080
2022-02-16 17:56:18 +00:00
upstreams {
destination_name = "mysql-server"
# TODO: how do I get these to not bind to the host eth0 address
local_bind_port = 4040
}
2022-02-17 22:03:42 +00:00
2022-02-16 17:56:18 +00:00
config {
protocol = "tcp"
}
}
}
2022-02-17 22:03:42 +00:00
sidecar_task {
resources {
cpu = 50
memory = 25
}
}
2022-02-16 17:56:18 +00:00
}
tags = [
"traefik.enable=true",
]
}
task "adminer" {
driver = "docker"
config {
image = "adminer"
ports = ["adminer"]
}
env = {
"ADMINER_DEFAULT_SERVER" = "${NOMAD_UPSTREAM_ADDR_mysql_server}"
}
resources {
cpu = 50
memory = 50
}
}
}
}