docs: Update namespaced DNS services section for partitions format

This commit is contained in:
Kyle Havlovitz 2021-12-14 11:05:41 -08:00
parent 6a97a5d02e
commit 1d720abe58
2 changed files with 13 additions and 27 deletions

View File

@ -1457,7 +1457,8 @@ bind_addr = "{{ GetPrivateInterfaces | include \"network\" \"10.0.0.0/8\" | attr
equivalent to "no max age". To get a fresh value from the cache use a very small value
of `1ns` instead of 0.
- `prefer_namespace` ((#dns_prefer_namespace)) <EnterpriseAlert inline /> -
- `prefer_namespace` ((#dns_prefer_namespace)) <EnterpriseAlert inline /> **Deprecated in
Consul 1.11. Use the [canonical DNS format](/docs/discovery/dns#namespaced-partitioned-services) instead.** -
When set to true, in a DNS query for a service, the label between the domain
and the `service` label will be treated as a namespace name instead of a datacenter.
When set to false, the default, the behavior will be the same as non-Enterprise

View File

@ -335,37 +335,22 @@ using the [`advertise-wan`](/docs/agent/options#_advertise-wan) and
[`translate_wan_addrs`](/docs/agent/options#translate_wan_addrs) configuration
options.
## Namespaced Services <EnterpriseAlert inline />
## Namespaced/Partitioned Services <EnterpriseAlert inline />
Consul Enterprise 1.7.0 added support for namespaces including resolving namespaced
services via DNS. To maintain backwards compatibility existing queries can be used
and these will resolve services within the `default` namespace. However, for resolving
services from other namespaces the following form can be used:
Consul Enterprise supports resolving namespaced and partitioned services via DNS.
To maintain backwards compatibility existing queries can be used and these will
resolve services within the `default` namespace and partition. However, for resolving
services from other namespaces or partitions the following form can be used:
```text
[tag.]<service>.service.<namespace>.<datacenter>.<domain>
[tag.]<service>.service[.<namespace>.ns][.<partition>.ap][.<datacenter>.dc].<domain>
```
This is the canonical name of a Consul Enterprise service with all parts present. Like
Consul OSS some parts may be omitted but which parts depend on the value of the
[`prefer_namespace` configuration](/docs/agent/options#dns_prefer_namespace).
With `prefer_namespace` set to `true` the datacenter may be omitted and will be defaulted
to the local agents datacenter:
```text
[tag.]<service>.service.<namespace>.<domain>
```
With `prefer_namespace` set to `false` the namespace may be omitted and will be defaulted
to the `default` namespace:
```text
[tag.]<service>.service.<datacenter>
```
Finally, both the namespace and datacenter may be omitted and the service will be resolved
in the `default` namespace and in the datacenter of the local agent.
This is the canonical name of a Consul Enterprise service. Currently all parts must be
present - in a future version (once the
[`prefer_namespace` configuration](/docs/agent/options#dns_prefer_namespace) has been
deprecated), these may be individually omitted to default to the `default`
namespace, local partition or local datacenter respectively.
## DNS with ACLs