Score:1

Trouble to understand how networking works on nomad

cn flag

Can someone explain why I can't access my website running in a docker container thru nomad or what I'm doing wrong ? I'm beginner in system and networking.

I would like to make the container http listen on 127.0.0.1:8088 so that nginx can proxy.

Nomad server and client are running on the same machine

Machine is fedora, disabled SELinux, firewall disabled.

What I expect : Request to <server_ip>:8088 responds website

What I get : Response is Connection refused.

nomad conf :

data_dir  = "/opt/nomad/data"
bind_addr = "0.0.0.0"
log_level = "DEBUG"

server {
  # license_path is required for Nomad Enterprise as of Nomad v1.1.1+
  #license_path = "/etc/nomad.d/license.hclic"
  enabled          = true
  bootstrap_expect = 1
}
acl {
   enabled = true
}

client {
  enabled = true
  servers = ["127.0.0.1"]
}

nomad job :


job "ctprods-app" {
  datacenters = ["*"]

  group "ctprods-group" {
    count = 1
    network {
      port "http" {
         static = 8088
         to = 8088
      }
    }
    task "ctprods-task" {
      driver = "docker"
      env {
          ENVIRONMENT = "production"
      }
      config {
        image = "ctaque/ctprods:latest"
        ports = [
          "http"
        ]
      }
    }
  }
}

nginx block :

location / {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass http://127.0.0.1:8088/;
}

ss -nplut :

tcp LISTEN  0  4096 <server_public_ip>:8088 0.0.0.0:*

nomad job port map : nomad job port map

nomad job running : nomad job running

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.