2019-07-09 02:11:19 +00:00
---
2020-04-07 18:55:19 +00:00
layout: docs
2020-04-06 20:27:35 +00:00
page_title: 'Configuration Entry Kind: Service Resolver'
2020-04-07 18:55:19 +00:00
description: >-
The `service-resolver` config entry kind controls which service instances
should satisfy Connect upstream discovery requests for a given service name.
2019-07-09 02:11:19 +00:00
---
2019-08-21 21:23:08 +00:00
# Service Resolver
2019-07-09 02:11:19 +00:00
2020-12-16 16:57:43 +00:00
-> **v1.8.4+:** On Kubernetes, the `ServiceResolver` custom resource is supported in Consul versions 1.8.4+.<br />
**v1.6.0+:** On other platforms, this config entry is supported in Consul versions 1.6.0+.
2020-04-09 00:09:01 +00:00
2020-12-16 16:57:43 +00:00
The `service-resolver` config entry kind (`ServiceResolver` on Kubernetes) controls which service instances
2019-07-09 02:11:19 +00:00
should satisfy Connect upstream discovery requests for a given service name.
If no resolver config is defined the chain assumes 100% of traffic goes to the
healthy instances of the default service in the current datacenter+namespace
and discovery terminates.
## Interaction with other Config Entries
- Service resolver config entries are a component of [L7 Traffic
2022-01-10 23:36:16 +00:00
Management](/docs/connect/l7-traffic).
2019-07-09 02:11:19 +00:00
2022-01-19 19:18:26 +00:00
## UI
2022-01-10 23:14:24 +00:00
2022-01-11 16:18:36 +00:00
Once a `service-resolver` is successfully entered, you can view it in the UI. Service routers, service splitters, and service resolvers can all be viewed by clicking on your service then switching to the *routing* tab.
2022-01-10 23:14:24 +00:00
![screenshot of service resolver in the UI](/img/l7-routing/Resolver.png)
2019-07-09 02:11:19 +00:00
## Sample Config Entries
2020-12-16 16:57:43 +00:00
### Filter on service version
2019-07-09 02:11:19 +00:00
Create service subsets based on a version metadata and override the defaults:
2021-06-13 00:53:50 +00:00
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
2019-07-09 02:11:19 +00:00
```hcl
2020-06-16 18:28:21 +00:00
Kind = "service-resolver"
Name = "web"
2020-06-15 21:14:36 +00:00
DefaultSubset = "v1"
Subsets = {
2021-06-13 00:53:50 +00:00
v1 = {
2020-06-15 21:14:36 +00:00
Filter = "Service.Meta.version == v1"
2019-07-09 02:11:19 +00:00
}
2021-06-13 00:53:50 +00:00
v2 = {
2020-06-15 21:14:36 +00:00
Filter = "Service.Meta.version == v2"
2019-07-09 02:11:19 +00:00
}
}
```
2020-12-16 16:57:43 +00:00
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: web
spec:
2021-06-13 00:53:50 +00:00
defaultSubset: v1
2020-12-16 16:57:43 +00:00
subsets:
2021-06-13 00:53:50 +00:00
v1:
2020-12-16 16:57:43 +00:00
filter: 'Service.Meta.version == v1'
2021-06-13 00:53:50 +00:00
v2:
2020-12-16 16:57:43 +00:00
filter: 'Service.Meta.version == v2'
```
2021-06-13 00:53:50 +00:00
```json
{
"Kind": "service-resolver",
"Name": "web",
"DefaultSubset": "v1",
"Subsets": {
"v1": {
"Filter": "Service.Meta.version == v1"
},
"v2": {
"Filter": "Service.Meta.version == v2"
}
}
}
```
</CodeTabs>
2020-12-16 16:57:43 +00:00
### Other datacenters
2019-07-09 02:11:19 +00:00
Expose a set of services in another datacenter as a virtual service:
2021-06-13 00:53:50 +00:00
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
2019-07-09 02:11:19 +00:00
```hcl
2020-06-15 21:14:36 +00:00
Kind = "service-resolver"
Name = "web-dc2"
Redirect {
Service = "web"
Datacenter = "dc2"
2019-07-09 02:11:19 +00:00
}
```
2020-12-16 16:57:43 +00:00
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: web-dc2
spec:
redirect:
service: web
datacenter: dc2
```
2021-06-13 00:53:50 +00:00
```json
{
"Kind": "service-resolver",
"Name": "web-dc2",
"Redirect": {
"Service": "web",
"Datacenter": "dc2"
}
}
```
</CodeTabs>
2020-12-16 16:57:43 +00:00
2022-01-10 18:41:43 +00:00
### Failover
2020-12-16 16:57:43 +00:00
2022-01-10 18:41:43 +00:00
Enable failover for subset `v2` to `dc2`, and all other subsets to `dc3` or `dc4`:
2020-12-16 16:57:43 +00:00
2021-06-13 00:53:50 +00:00
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
2019-07-09 02:11:19 +00:00
```hcl
2020-06-16 18:28:21 +00:00
Kind = "service-resolver"
Name = "web"
2020-06-15 21:14:36 +00:00
ConnectTimeout = "15s"
Failover = {
2021-06-13 00:53:50 +00:00
v2 = {
Datacenters = ["dc2"]
}
2019-07-09 02:11:19 +00:00
"*" = {
2020-06-15 21:14:36 +00:00
Datacenters = ["dc3", "dc4"]
2019-07-09 02:11:19 +00:00
}
}
```
2020-12-16 16:57:43 +00:00
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: web
spec:
connectTimeout: 15s
failover:
2021-06-13 00:53:50 +00:00
v2:
datacenters: ['dc2']
2020-12-16 16:57:43 +00:00
'*':
datacenters: ['dc3', 'dc4']
2019-07-09 02:11:19 +00:00
```
2021-06-13 00:53:50 +00:00
```json
{
"Kind": "service-resolver",
"Name": "web",
"ConnectTimeout": "15s",
"Failover": {
"v2": {
"Datacenters": ["dc2"]
},
"*": {
"Datacenters": ["dc3", "dc4"]
}
}
}
```
2020-12-16 16:57:43 +00:00
2021-06-13 00:53:50 +00:00
</CodeTabs>
2020-12-16 16:57:43 +00:00
2022-09-09 20:57:23 +00:00
Enable failover to a WAN federated datacenter and then a cluster peer for all
service subsets.
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
```hcl
Kind = "service-resolver"
Name = "web"
ConnectTimeout = "15s"
Failover = {
"*" = {
Targets = [
{Datacenter = "dc3"},
{Peer = "peer-01"}
]
}
}
```
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: web
spec:
connectTimeout: 15s
failover:
'*':
targets:
- datacenter: "dc3"
- peer: "peer-01"
```
```json
{
"Kind": "service-resolver",
"Name": "web",
"ConnectTimeout": "15s",
"Failover": {
"*": {
"Targets": [
{"Datacenter": "dc3"},
{"Peer": "peer-01"}
]
}
}
}
```
</CodeTabs>
2022-01-10 17:45:54 +00:00
<EnterpriseAlert product="consul">
2022-01-10 18:22:53 +00:00
Failover to another datacenter and namespace for all service subsets.
2022-01-10 17:45:54 +00:00
</EnterpriseAlert>
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
```hcl
Kind = "service-resolver"
Name = "product-api"
Namespace = "primary"
ConnectTimeout = "0s"
Failover = {
"*" = {
Datacenters = ["dc2"]
2022-01-10 18:22:53 +00:00
Namespace = "secondary"
2022-01-10 17:45:54 +00:00
}
}
```
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: product-api
namespace: primary
spec:
2022-01-10 18:41:43 +00:00
connectTimeout: 0s
2022-01-10 17:45:54 +00:00
failover:
namespace: 'secondary'
2022-01-10 18:41:43 +00:00
datacenters: ['dc2']
2022-01-10 17:45:54 +00:00
```
```json
{
"Kind": "service-resolver",
"Name": "product-api",
2022-01-10 18:41:43 +00:00
"Namespace": "primary",
2022-01-10 17:45:54 +00:00
"ConnectTimeout": "0s",
"Failover": {
"*": {
2022-01-10 18:41:43 +00:00
"Datacenters": ["dc2"],
"Namespace": "secondary"
}
}
}
```
</CodeTabs>
<EnterpriseAlert product="consul">
Failover within a datacenter and a different namespace.
</EnterpriseAlert>
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
```hcl
Kind = "service-resolver"
Name = "product-api"
Namespace = "primary"
ConnectTimeout = "0s"
Failover = {
"*" = {
Service = "product-api-backup"
Namespace = "secondary"
}
}
```
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: product-api
namespace: primary
spec:
connectTimeout: 0s
failover:
service: 'product-api-backup'
namespace: 'secondary'
```
```json
{
"Kind": "service-resolver",
"Name": "product-api",
"Namespace": "primary",
"ConnectTimeout": "0s",
"Failover": {
"*": {
"Service": "product-api-backup",
2022-01-10 17:45:54 +00:00
"Namespace": "secondary"
}
}
}
```
</CodeTabs>
2021-06-13 00:53:50 +00:00
### Consistent load balancing
2020-12-16 16:57:43 +00:00
2020-08-28 20:46:13 +00:00
Apply consistent load balancing for requests based on `x-user-id` header:
2021-06-13 00:53:50 +00:00
<CodeTabs tabs={[ "HCL", "Kubernetes YAML", "JSON" ]}>
2020-08-28 20:46:13 +00:00
```hcl
Kind = "service-resolver"
Name = "web"
LoadBalancer = {
Policy = "maglev"
HashPolicies = [
{
Field = "header"
2020-09-02 15:10:50 +00:00
FieldValue = "x-user-id"
2020-08-28 20:46:13 +00:00
}
]
}
```
2020-12-16 16:57:43 +00:00
```yaml
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceResolver
metadata:
name: web
spec:
loadBalancer:
policy: maglev
hashPolicies:
- field: header
fieldValue: x-user-id
```
2020-12-08 23:24:36 +00:00
2021-06-13 00:53:50 +00:00
```json
{
"Kind": "service-resolver",
"Name": "web",
"LoadBalancer": {
"Policy": "maglev",
"HashPolicies": [
{
"Field": "header",
"FieldValue": "x-user-id"
}
]
}
}
```
</CodeTabs>
2020-12-08 23:24:36 +00:00
2020-12-16 16:57:43 +00:00
## Available Fields
2020-12-08 23:24:36 +00:00
2020-12-16 16:57:43 +00:00
<ConfigEntryReference
keys={[
{
name: 'apiVersion',
description: 'Must be set to `consul.hashicorp.com/v1alpha1`',
hcl: false,
},
{
name: 'Kind',
description: {
hcl: 'Must be set to `service-resolver`',
yaml: 'Must be set to `ServiceResolver`',
},
},
{
name: 'Name',
description: 'Set to the name of the service being configured.',
type: 'string: <required>',
yaml: false,
},
{
name: 'Namespace',
type: `string: "default"`,
enterprise: true,
2022-01-03 22:40:03 +00:00
description:
'Specifies the namespace in which the configuration entry will apply.',
2021-12-21 00:30:39 +00:00
yaml: false,
},
{
name: 'Partition',
type: `string: "default"`,
enterprise: true,
2022-01-03 22:40:03 +00:00
description:
'Specifies the admin partition in which the configuration entry will apply.',
2020-12-16 16:57:43 +00:00
yaml: false,
},
{
name: 'Meta',
type: 'map<string|string>: nil',
description:
'Specifies arbitrary KV metadata pairs. Added in Consul 1.8.4.',
yaml: false,
},
{
name: 'metadata',
children: [
{
name: 'name',
description: 'Set to the name of the service being configured.',
},
2021-01-07 19:22:06 +00:00
{
name: 'namespace',
description:
'If running Consul Open Source, the namespace is ignored (see [Kubernetes Namespaces in Consul OSS](/docs/k8s/crds#consul-oss)). If running Consul Enterprise see [Kubernetes Namespaces in Consul Enterprise](/docs/k8s/crds#consul-enterprise) for more details.',
},
2020-12-16 16:57:43 +00:00
],
hcl: false,
},
{
name: 'ConnectTimeout',
type: 'duration: 0s',
description:
'The timeout for establishing new network connections to this service.',
},
{
name: 'DefaultSubset',
type: 'string: ""',
description:
2022-09-09 20:57:23 +00:00
'The subset to use when no explicit subset is requested. If empty, the unnamed subset is used.',
2020-12-16 16:57:43 +00:00
},
{
name: 'Subsets',
type: 'map[string]ServiceResolverSubset',
description:
'A map of subset name to subset definition for all usable named subsets of this service. The map key is the name of the subset and all names must be valid DNS subdomain elements.<br><br>This may be empty, in which case only the unnamed default subset will be usable.',
children: [
{
name: 'Filter',
type: 'string: ""',
2022-03-30 21:16:26 +00:00
description: `The [filter expression](/api-docs/features/filtering) to be used for selecting
2022-09-09 20:57:23 +00:00
instances of the requested service. If empty, all healthy instances are
2020-12-16 16:57:43 +00:00
returned. This expression can filter on the same selectors as the
2022-03-30 21:16:26 +00:00
[Health API endpoint](/api-docs/health#filtering-2).`,
2020-12-16 16:57:43 +00:00
},
{
name: 'OnlyPassing',
type: 'bool: false',
description: `Specifies the behavior of the resolver's
health check interpretation. If this is set to false, instances with checks
in the passing as well as the warning states will be considered healthy. If
this is set to true, only instances with checks in the passing state will
be considered healthy.`,
},
],
},
{
name: 'Redirect',
type: 'ServiceResolverRedirect: <optional>',
description: {
2021-01-07 19:40:59 +00:00
hcl: `When configured, all attempts to resolve the service this resolver defines will be substituted for the supplied redirect EXCEPT when the redirect has already been applied.
2020-12-16 16:57:43 +00:00
<br><br>
2021-01-07 19:40:59 +00:00
When \`Redirect\` is set, all other fields besides \`Kind\`, \`Name\`, \`Namespace\` and \`Redirect\` will be ignored.`,
yaml: `When configured, all attempts to resolve the service this resolver defines will be substituted for the supplied redirect EXCEPT when the redirect has already been applied.
2020-12-16 16:57:43 +00:00
<br><br>
2021-01-07 19:40:59 +00:00
When \`redirect\` is set, all other fields besides \`redirect\` will be ignored.`,
2020-12-16 16:57:43 +00:00
},
children: [
{
name: 'Service',
type: 'string: ""',
description: 'A service to resolve instead of the current service.',
},
{
name: 'ServiceSubset',
type: 'string: ""',
description: {
hcl: `A named subset of the given service to
resolve instead of one defined as that service's \`DefaultSubset\`. If empty, the
default subset is used.
<br><br>
If this is specified at least one of \`Service\`, \`Datacenter\`, or \`Namespace\`
should be configured.`,
yaml: `A named subset of the given service to
resolve instead of one defined as that service's \`defaultSubset\`. If empty, the
default subset is used.
<br><br>
If this is specified at least one of \`service\`, \`datacenter\`, or \`namespace\`
should be configured.`,
},
},
{
name: 'Namespace',
enterprise: true,
type: 'string: ""',
description:
2022-01-03 22:40:03 +00:00
'Specifies the destination namespace to resolve the service from.',
2021-12-21 00:30:39 +00:00
},
{
name: 'Partition',
enterprise: true,
type: 'string: ""',
description:
2022-01-03 22:40:03 +00:00
'Specifies the destination admin partition to resolve the service from.',
2020-12-16 16:57:43 +00:00
},
{
name: 'Datacenter',
type: 'string: ""',
description:
2022-01-03 22:40:03 +00:00
'Specifies the destination datacenter to resolve the service from.',
2020-12-16 16:57:43 +00:00
},
2022-09-09 20:57:23 +00:00
{
name: 'Peer',
type: 'string: ""',
description:
`Specifies the destination cluster peer to resolve the target service name from.
Ensure that [intentions are defined](/docs/connect/cluster-peering/create-manage-peering#authorize-services-for-peers)
on the peered cluster to allow the source service to access this redirect target service as an upstream. When
the peer name is specified, Consul uses Envoy'services outlier detection to determine
the health of the redirect target based on whether communication attempts to the
redirect target are generally successful. Service health checks imported from a peer
are not considered in the health of a redirect target because they do not account for service
routers, splitters, and resolvers that may be defined in the peer for the target service.`,
},
2020-12-16 16:57:43 +00:00
],
},
{
name: 'Failover',
type: 'map[string]ServiceResolverFailover',
description: {
hcl: `Controls when and how to
reroute traffic to an alternate pool of service instances.
<br><br>
The map is keyed by the service subset it applies to and the special
string \`"*"\` is a wildcard that applies to any subset not otherwise
specified here.
<br><br>
2022-09-09 20:57:23 +00:00
\`Service\`, \`ServiceSubset\`, \`Namespace\`, \`Targets\`, and
\`Datacenters\` cannot all be empty at once.`,
2020-12-16 16:57:43 +00:00
yaml: `Controls when and how to
reroute traffic to an alternate pool of service instances.
<br><br>
The map is keyed by the service subset it applies to and the special
string \`"*"\` is a wildcard that applies to any subset not otherwise
specified here.
<br><br>
2022-09-09 20:57:23 +00:00
\`service\`, \`serviceSubset\`, \`namespace\`, \`targets\` and
\`datacenters\` cannot all be empty at once.`,
2020-12-16 16:57:43 +00:00
},
children: [
{
name: 'Service',
type: 'string: ""',
description:
'The service to resolve instead of the default as the failover group of instances during failover.',
},
{
name: 'ServiceSubset',
type: 'string: ""',
description:
2022-09-09 20:57:23 +00:00
'The named subset of the requested service to resolve as the failover group of instances. If empty, the default subset for the requested service is used.',
2020-12-16 16:57:43 +00:00
},
{
name: 'Namespace',
enterprise: true,
type: 'string: ""',
description:
2022-09-09 20:57:23 +00:00
'The namespace to resolve the requested service from to form the failover group of instances. If empty, the current namespace is used.',
2020-12-16 16:57:43 +00:00
},
{
name: 'Datacenters',
type: 'array<string>',
description: 'A fixed list of datacenters to try during failover.',
},
2022-09-09 20:57:23 +00:00
{
name: 'Targets',
type: 'array<ServiceResolverFailoverTarget>',
description: `A fixed list of failover targets to try during
failover. It allows operators to express complicated failover
scenarios such as between cluster peers, WAN federated datacenters, and local admin partitions.`,
children: [
{
name: 'Service',
type: 'string: ""',
description:
'The service name to use for the failover target. If empty, the current service name is used.',
},
{
name: 'ServiceSubset',
type: 'string: ""',
description:
'The named subset to use for the failover target. If empty, the default subset for the requested service name is used.',
},
{
name: 'Namespace',
enterprise: true,
type: 'string: ""',
description:
`The namespace to use for the failover target. If empty, the \`default\` namespace is used.`,
},
{
name: 'Partition',
enterprise: true,
type: 'string: ""',
description:
`The admin partition within the same datacenter to use for the failover target.
If empty, the \`default\` partition is used.
To use an admin partition in a different datacenter for the failover target,
use the \`Peer\` field instead.`,
},
{
name: 'Datacenter',
type: 'string: ""',
description:
`The WAN federated datacenter to use for the failover target.
If empty, the current datacenter is used.
To use a datacenter for the failover target that is connected
with a cluster peering relationship rather than WAN federation,
use the \`Peer\` field instead.`,
},
{
name: 'Peer',
type: 'string: ""',
description:
`Specifies the destination cluster peer to resolve the target service name from.
Ensure that [intentions are defined](/docs/connect/cluster-peering/create-manage-peering#authorize-services-for-peers)
on the peered cluster to allow the source service to access this failover target service as an upstream.
When the peer name is specified, Consul uses Envoy's outlier detection
to determine the health of the failover target based on
whether communication attempts to the failover target are generally successful.
Service health checks imported from a peer are not considered in the health
of a failover target because they do not account for service routers, splitters, and resolvers
that may be defined in the peer for the target service.`,
},
],
},
2020-12-16 16:57:43 +00:00
],
},
{
name: 'LoadBalancer',
type: 'LoadBalancer',
description:
'Determines the load balancing policy and configuration for services issuing requests to this upstream. This option is available in Consul versions 1.9.0 and newer.',
children: [
{
name: 'Policy',
type: 'string: ""',
description:
'The load balancing policy used to select a host. One of: `random`, `round_robin`, `least_request`, `ring_hash`, `maglev`.',
},
{
name: 'RingHashConfig',
type: 'RingHashConfig',
description: 'Configuration for the `ring_hash` policy type.',
children: [
{
2022-01-19 19:18:26 +00:00
name: 'MinimumRingSize',
2020-12-16 16:57:43 +00:00
type: 'int: 1024',
description:
'Determines the minimum number of entries in the hash ring.',
},
{
2022-01-19 19:18:26 +00:00
name: 'MaximumRingSize',
2020-12-16 16:57:43 +00:00
type: 'int: 8192',
description:
'Determines the maximum number of entries in the hash ring.',
},
],
},
{
name: 'LeastRequestConfig',
type: 'LeastRequestConfig',
description: 'Configuration for the `least_request` policy type.',
children: [
{
name: 'ChoiceCount',
type: 'int: 2',
description:
'Determines the number of random healthy hosts from which to select the one with the least requests.',
},
],
},
{
name: 'HashPolicies',
type: 'array<HashPolicies>',
description: `List of hash policies to use for
hashing load balancing algorithms. Hash policies are evaluated individually
and combined such that identical lists result in the same hash.
If no hash policies are present, or none are successfully evaluated,
then a random backend host will be selected.`,
children: [
{
name: 'Field',
type: 'string: ""',
description: {
hcl:
2021-03-15 21:39:33 +00:00
'The attribute type to hash on. Must be one of `header`, `cookie`, or `query_parameter`. Cannot be specified along with `SourceIP`.',
2020-12-16 16:57:43 +00:00
yaml:
2021-03-15 21:39:33 +00:00
'The attribute type to hash on. Must be one of `header`, `cookie`, or `query_parameter`. Cannot be specified along with `sourceIP`.',
2020-12-16 16:57:43 +00:00
},
},
{
name: 'FieldValue',
type: 'string: ""',
description: {
hcl:
2021-03-15 21:39:33 +00:00
'The value to hash. ie. header name, cookie name, URL query parameter name. Cannot be specified along with `SourceIP`.',
2020-12-16 16:57:43 +00:00
yaml:
2021-03-15 21:39:33 +00:00
'The value to hash. ie. header name, cookie name, URL query parameter name. Cannot be specified along with `sourceIP`.',
2020-12-16 16:57:43 +00:00
},
},
{
name: 'CookieConfig',
type: 'CookieConfig',
description:
'Additional configuration for the "cookie" hash policy type. This is specified to have Envoy generate a cookie for a client on its first request.',
children: [
{
name: 'Session',
type: 'bool: false',
description: 'Generates a session cookie with no expiration.',
},
{
name: 'TTL',
type: 'duration: 0s',
description:
'TTL for generated cookies. Cannot be specified for session cookies.',
},
{
name: 'Path',
type: 'string: ""',
description: 'The path to set for the cookie.',
},
],
},
{
name: 'SourceIP',
type: 'bool: false',
description: {
hcl:
'Determines whether the hash should be of the source IP address rather than of a field and field value. Cannot be specified along with `Field` or `FieldValue`.',
yaml:
'Determines whether the hash should be of the source IP address rather than of a field and field value. Cannot be specified along with `field` or `fieldValue`.',
},
},
{
name: 'Terminal',
type: 'bool: false',
description:
'Will short circuit the computation of the hash when multiple hash policies are present. If a hash is computed when a Terminal policy is evaluated, then that hash will be used and subsequent hash policies will be ignored.',
},
],
},
],
},
]}
/>
2019-07-09 02:11:19 +00:00
## Service Subsets
A service subset assigns a concrete name to a specific subset of discoverable
service instances within a datacenter, such as `"version2"` or `"canary"`.
A service subset name is useful only when composed with an actual service name,
a specific datacenter, and namespace.
All services have an unnamed default subset that will return all healthy
instances unfiltered.
Subsets are defined in `service-resolver` configuration entries, but are
referenced by their names throughout the other configuration entry kinds.
## ACLs
2020-10-14 15:23:05 +00:00
Configuration entries may be protected by [ACLs](/docs/security/acl).
2019-07-09 02:11:19 +00:00
2020-10-14 15:23:05 +00:00
Reading a `service-resolver` config entry requires `service:read` on the resource.
2019-07-09 02:11:19 +00:00
Creating, updating, or deleting a `service-resolver` config entry requires
2020-10-14 15:23:05 +00:00
`service:write` on the resource and `service:read` on any other service referenced by
2019-07-09 02:11:19 +00:00
name in these fields:
- [`Redirect.Service`](#service)
- [`Failover[].Service`](#service-1)