Skip to content

Commit

Permalink
Fix type of datacenter in Service Resolvers Config Entry (#19004)
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelightning committed Sep 27, 2023
1 parent cbbc740 commit 97e43e9
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions website/content/docs/connect/config-entries/service-resolver.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: docs
page_title: Service Resolver Configuration Entry Reference
description: >-
description: >-
Service resolver configuration entries are L7 traffic management tools for defining sets of service instances that resolve upstream requests and Consul’s behavior when resolving them. Learn how to write `service-resolver` config entries in HCL or YAML with a specification reference, configuration model, a complete example, and example code by use case.
---

Expand Down Expand Up @@ -35,7 +35,7 @@ The following list outlines field hierarchy, language-specific data types, and r
- [`ServiceSubset`](#redirect-servicesubset): string
- [`Namespace`](#redirect-namespace): string <EnterpriseAlert inline />
- [`Partition`](#redirect-partition): string | `default` <EnterpriseAlert inline />
- [`Datacenter`](#redirect-datacenter): list
- [`Datacenter`](#redirect-datacenter): string
- [`Peer`](#redirect-peer): string
- [`Failover`](#failover): map
- [`Service`](#failover-service): string
Expand Down Expand Up @@ -132,8 +132,8 @@ When every field is defined, a service resolver configuration entry has the foll
```hcl
Kind = "service-resolver" ## required
Name = "<name-of-service-configuration-applies-to>"
Namespace = "<namespace-configuration-applies-to>"
Partition = "<partition-configuration-applies-to>"
Namespace = "<namespace-configuration-applies-to>"
Partition = "<partition-configuration-applies-to>"
Meta = {
<key> = "<value>"
}
Expand Down Expand Up @@ -215,7 +215,7 @@ LoadBalancer = {
"Kind":"service-resolver", // required
"Name":"<name-of-service-configuration-applies-to>",
"Namespace":"<namespace-configuration-applies-to>",
"Partition":"parition-configuration-applies-to>",
"Partition":"parition-configuration-applies-to>",
"Meta":{
"<key>":"<value>"
},
Expand Down Expand Up @@ -282,7 +282,7 @@ LoadBalancer = {
},
"SourceIP":false, // cannot specify with Field or FieldValue
"Terminal":false
}
}
]
}
}
Expand All @@ -294,7 +294,7 @@ LoadBalancer = {

```yaml
apiVersion: consul.hashicorp.com/v1alpha1 # required
kind: ServiceResolver # required
kind: ServiceResolver # required
metadata:
name: <serviceName>
namespace: <namespace>
Expand All @@ -309,14 +309,14 @@ spec:
filter: <expression.to.match.on == value02>
onlyPassing: false
defaultSubset: <definedSubsetName>
redirect:
redirect:
service: <serviceName>
servicesubset: <subsetName>
namespace: <namespaceName>
partition: <partitionName>
peer: <peerName>
failover: # requires at least one of the following: service, serviceSubset, namespace, targets, datacenters
<localSubsetName>:
<localSubsetName>:
targets:
- service: <serviceName>
- serviceSubset: <serviceSubset>
Expand Down Expand Up @@ -438,7 +438,7 @@ For additional guidance, refer to the [filter on service version configuration e
- Data type: Map containing a key-value pair.
- `<KEY>`: String that names the subset. The string must be valid as a DNS subdomain element.
- `<VALUE>`: Map that can contain the following parameters:

| Parameter | Description | Data type | Default |
| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- |
| `Filter` | Specifies an expression that filters the DNS elements of service instances that belong to the subset. If empty, all healthy instances of a service are returned. This expression can filter on the same DNS selectors as the [Health API endpoint](/consul/api-docs/health#filtering-2). For more information about creating and using expressions to filter, refer to [filtering](/consul/api-docs/features/filtering). | String | None |
Expand Down Expand Up @@ -540,7 +540,7 @@ This parameter is a map, and its key is the name of the local service subset tha
- [`Namespace`](#failover-namespace)
- [`Datacenters`](#failover-datacenters)
- [`Targets`](#failover-targets)

### `Failover{}.Service`

Specifies the name of the service to resolve at the failover location during a failover scenario.
Expand Down Expand Up @@ -680,10 +680,10 @@ Specifies the type of load balancing policy for selecting a host. Supported load
- Data type: String containing one of the following values:

- `random`
- `round_robin`
- `round_robin`
- `least_request`
- `ring_hash`
- `maglev`
- `ring_hash`
- `maglev`

### `LoadBalancer{}.LeastRequestConfig`

Expand All @@ -693,7 +693,7 @@ Specifies configuration for the `least_request` policy type.

- Default: None
- Data type: Map containing the following parameter:

| Parameter | Description | Data type | Default |
| :------------ | :------------------------------------------------------------------------------------------------- | --------- | ------- |
| `ChoiceCount` | Specifies the number of random healthy hosts from which to select the one with the least requests. | Integer | `2` |
Expand All @@ -706,7 +706,7 @@ Specifies configuration for the `ring_hash` policy type.

- Default: None
- Data type: List that can contain the following parameters:

| Parameter | Description | Data type | Default |
| :------------ | :------------------------------------------------------------- | --------- | ------- |
| `MinimumRingSize` | Determines the minimum number of entries in the hash ring. | Integer | `1024` |
Expand Down Expand Up @@ -763,7 +763,7 @@ Specifies additional configuration options for the `cookie` hash policy type. Th

- Default: None
- Data type: Map that can contain the following parameters:

| Parameter | Description | Data type | Default |
| :------------- | :-------------------------------------------------------------------------------- | --------- | ------- |
| `Session` | Directs Consul to generate a session cookie with no expiration. | Boolean | `false` |
Expand All @@ -778,7 +778,7 @@ Determines if the hash type should besource IP address. You cannot specify `Sour

- Default: `false`
- Data type: Boolean

### `LoadBalancer{}.HashPolicies[].Terminal`

Determines if Consul should stop computing the hash when multiple hash policies are present. If a hash is computed when a terminal policy is evaluated, then that hash is used and subsequent hash policies are ignored.
Expand All @@ -787,14 +787,14 @@ Determines if the hash type should besource IP address. You cannot specify `Sour

- Default: `false`
- Data type: Boolean

</Tab>

<Tab heading="YAML" group="yaml">

### `apiVersion`

Specifies the version of the Consul API for integrating with Kubernetes. The value must be `consul.hashicorp.com/v1alpha1`.
Specifies the version of the Consul API for integrating with Kubernetes. The value must be `consul.hashicorp.com/v1alpha1`.

#### Values

Expand All @@ -814,7 +814,7 @@ Specifies the type of configuration entry to implement. Must be set to `ServiceR

## `metadata`

Map that contains an arbitrary name for the configuration entry and the namespace it applies to.
Map that contains an arbitrary name for the configuration entry and the namespace it applies to.

#### Values

Expand Down Expand Up @@ -982,7 +982,7 @@ This parameter is a map, and its key is the name of the local service subset tha
- [`namespace`](#spec-failover-namespace)
- [`datacenters`](#spec-failover-datacenters)
- [`targets`](#spec-failover-targets)

### `spec.failover.service`

Specifies the name of the service to resolve at the failover location during a failover scenario.
Expand Down Expand Up @@ -1121,9 +1121,9 @@ Specifies the type of load balancing policy for selecting a host. Supported load
- Data type: String containing one of the following values:

- `random`
- `round_robin`
- `round_robin`
- `least_request`
- `ring_hash`
- `ring_hash`
- `maglev`

### `spec.loadBalancer.leastRequestConfig`
Expand All @@ -1134,7 +1134,7 @@ Specifies configuration for the `least_request` policy type.

- Default: None
- Data type: Map containing the following parameter:

| Parameter | Description | Data type | Default |
| :------------ | :------------------------------------------------------------------------------------------------- | --------- | ------- |
| `choiceCount` | Specifies the number of random healthy hosts from which to select the one with the least requests. | Integer | `2` |
Expand All @@ -1147,7 +1147,7 @@ Specifies configuration for the `ring_hash` policy type.

- Default: None
- Data type: List that can contain the following parameters:

| Parameter | Description | Data type | Default |
| :------------ | :------------------------------------------------------------- | --------- | ------- |
| `minimumRingSize` | Determines the minimum number of entries in the hash ring. | Integer | `1024` |
Expand All @@ -1171,7 +1171,7 @@ Specifies a list of hash policies to use for hashing load balancing algorithms.

Specifies the attribute type to hash on. You cannot specify the `field` parameter if `sourceIP` is also configured.

Supported attribute types include the following:
Supported attribute types include the following:

| Attribute | Description |
| :--------- | :-------------------------------------------------------------- |
Expand Down Expand Up @@ -1204,7 +1204,7 @@ Specifies additional configuration options for the `cookie` hash policy type. Th

- Default: None
- Data type: Map that can contain the following parameters:

| Parameter | Description | Data type | Default |
| :------------- | :-------------------------------------------------------------------------------- | --------- | ------- |
| `session` | Directs Consul to generate a session cookie with no expiration. | Boolean | `false` |
Expand Down

0 comments on commit 97e43e9

Please sign in to comment.