A namespace is a collection of nomad jobs in the same directory. Sub-directories are sub-namespaces. When instanciated, a namespace is allocated an identifier (8 character unique ID). Before being inserted in nomad, the jobs are modified to include this namespace identifier:
- the nomad job name is prefixed by "NAMESPACE-" (the namespace identifier)
- the consul service definitions are prefixed by "NAMESPACE-" (the namespace identifier)
- the services have an additional environment variable: CONSUL_NAMESPACE_ID
sub-namespaces are also inserted in the system when their parent namespace is inserted. Each sub-namespace is given an identifier the same way. The parent namespace is instanciated with:
- an environment variable CONSUL_NAMESPACE_ID_FOR_subnsname containing the sub namespace identifier