I am trying to setup some basic Nomad service and I get following error:
Template failed: health.service(global-redis-check|passing): Get "http://127.0.0.1:8500/v1/health/service/global-redis-check?passing=1&stale=&wait=60000ms": dial tcp 127.0.0.1:8500: connect: connection refused
Where is this port 8500 coming from?
job "nginx" {
datacenters = ["aws"]
group "nginx" {
count = 1
network {
port "http" {
static = 8080
}
}
service {
name = "nginx"
port = "http"
provider = "nomad"
}
task "nginx" {
driver = "docker"
config {
image = "nginx"
ports = ["http"]
volumes = [
"local:/etc/nginx/conf.d",
]
}
template {
data = <<EOF
upstream backend {
{{ range service "global-redis-check" }}
server {{ .Address }}:{{ .Port }};
{{ else }}server 127.0.0.1:65535; # force a 502
{{ end }}
}
server {
listen 8080;
location / {
proxy_pass http://backend;
}
}
EOF
destination = "local/load-balancer.conf"
change_mode = "signal"
change_signal = "SIGHUP"
}
}
}
}