liveBook · Manning

Nomad service

As explained in Road to Kubernetes

A Nomad service is a task- or group-level definition that registers a workload and assigns an accessible network port to its instances.

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.

How Road to Kubernetes covers it

How deep it goes
Explains task-level versus group-level selection, port mapping, dynamic allocation, and UI inspection.
Examples
Uses Python and JavaScript containers mapped to ports 8080 and 3000 with separate task-level services.
What it assumes
Assumes a Nomad job with container tasks and network port mappings already defined.
What you can do after
Operate/configure publicly reachable Nomad tasks by mapping container ports and adding service definitions.
How it connects
Connects Nomad jobs with tasks, groups, containers, network port mapping, and public IP addresses.

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.