Open ebarriosjr opened 4 years ago
Screenshot of nomad view: https://upload.thaller.ws/files/50a3fd4dad16e0c92d2f9789edb16ccaaf8bdc6b/2020-03-13_18-32-11_3608.png
job "nginx-este" {
datacenters = ["dc1"]
type = "service"
group "group1" {
count = 1
meta = {
version = "6"
}
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "8m"
auto_revert = true
}
task "task1" {
driver = "pot"
service {
tags = ["net-jail", "trv-metrics"]
name = "pot-webserver"
port = "bla"
address_mode="driver"
check {
address_mode="driver"
type = "tcp"
port = "bla"
name = "tcp"
interval = "5s"
timeout = "2s"
}
}
config {
image = "https://pot.pizzamig.dev/registry/"
pot = "FBSD120-nginx"
tag = "1.0"
command = "nginx"
args = [
" -g 'daemon off;'"
]
port_map = {
bla = "80"
}
network_mode = "alias"
ip = "172.20.132.251"
}
resources {
cpu = 200
memory = 128
network {
mbits = 10
port "bla" {
static = 80
}
}
}
}
}
}
This can be merge to master even though there is a bug in nomad where the nomad ui will show the wrong IP but the service will be register in consul with the IP from the alias. @pizzamig any thoughts on this?
it can land in master, and I would open an issue to document the bug
This works on the consul level but the address in nomad is still wrong.
Consul shows it as: https://upload.thaller.ws/files/5b070df9f0864c19b87031a47038e66889adf794/2020-03-13_18-30-25_3480.png
The ip specified inside the job is
172.20.132.251
as shown by consul.