#14177·nomad

nomad-sd: support cross-namespace service lookups within templates

Author: jrasellCreated Aug 18, 2022Updated Sep 2, 2026
Labelstype/enhancementtheme/templatetheme/auththeme/consul-templatestage/acceptedtheme/service-discovery/nomadhcc/jira

Proposal

Allow Nomad template blocks to perform cross namespace service lookups when using the nomadService and nomadServices template functions. Currently these lookups are restricted to the namespace within which the job running the template is running.

Use-cases

Jobs may be separated by namespace for management purposes, however, it is likely they are allowed to discover and communicate with each other.

Please see https://github.com/hashicorp/nomad/issues/12589 for additional comments.

Attempted Solutions

There is no current workaround for this expect to run jobs that need to discover each other within the same namespace. The initial implementation did not have the scope to solve the problem of how to authorise individual tasks to perform cross-namespace lookups.