A Nomad service registers a task or group and exposes each running instance through an accessible port. It connects container port mappings to publicly reachable client IP addresses and dynamically assigned ports. section 9.2.5
Choose the service level according to the workload’s port layout:
- Use a task-level service when tasks expose different ports, such as Python on 8080 and JavaScript on 3000. section 9.2.5
- Use a group-level service when services use the same port. section 9.2.5
- Nomad assigns available ports for each instance, preventing conflicts as counts, groups, or jobs increase. section 9.2.5
Registering two task services
After defining named network ports, attach each port to its task service: the Python task uses port "http-py" and the JavaScript task uses "http-js", both with provider = "nomad". The Nomad UI then shows each service’s exposed port and IP address.
