How to make contenders in a single group see each other?

Good morning, I have a hcl where I have configured 2 groups, one UI and one Task. The problem I have is that when I launch with Jenkins 3 or more containers, the tasks are not seen between them. How could I configure the hcl or the nomad network so that they are seen?

I hope I have explained myself well.

Thank you very much.

Ensure that you define a network stanza in your job file, specifying the ports needed for communication. Here’s an example of how you can configure it:
job “example” {
datacenters = [“dc1”]

group “ui” {
network {
mode = “bridge”
port “http” {
static = 8080
}
}

task "ui-task" {
  driver = "docker"
  config {
    image = "your-ui-image"
    ports = ["http"]
  }
}

}

group “task” {
network {
mode = “bridge”
port “app” {
static = 9090
}
}

task "task1" {
  driver = "docker"
  config {
    image = "your-task-image"
    ports = ["app"]
  }
}

}
}

hi. What do you mean by “see each other”? What do you need to “see”?

You can query Nomad API to get where the tasks are running and connect to them.

Each task may register a service in Consul, and then you could generate a template within each taks with addresses to each other.

It is unclear to me if you are asking how UI should “see” the one task, or how “jenkins 3 or more” should “see” the tasks. What is the relation of jenkins and uI and task and what does it mean to “see”?