From 8cb67745c72be44d84d88c91366b4d77db6752d8 Mon Sep 17 00:00:00 2001 From: Abdulaziz Elsheikh Date: Mon, 16 Oct 2023 10:45:56 +0100 Subject: [PATCH] updated consul nr docs to reflect latest changes Signed-off-by: Abdulaziz Elsheikh --- .../supported-name-resolution/setup-nr-consul.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-name-resolution/setup-nr-consul.md b/daprdocs/content/en/reference/components-reference/supported-name-resolution/setup-nr-consul.md index b5c8140e75a..ca15df0683a 100644 --- a/daprdocs/content/en/reference/components-reference/supported-name-resolution/setup-nr-consul.md +++ b/daprdocs/content/en/reference/components-reference/supported-name-resolution/setup-nr-consul.md @@ -25,11 +25,11 @@ spec: selfRegister: true ``` -If Consul service registration is managed externally from Dapr you need to ensure that the Dapr-to-Dapr internal gRPC port is added to the service metadata under `DAPR_PORT` (this key is configurable) and that the Consul service Id matches the Dapr app Id. You can then omit `selfRegister` from the config above. +If Consul service registration is managed externally from Dapr you need to ensure that the Dapr-to-Dapr internal gRPC port is added to the service metadata under `DAPR_PORT` (this key is configurable) and that the Consul service name matches the Dapr app Id. You can then omit `selfRegister` from the config above. ## Behaviour -On `init` the Consul component either validates the connection to the configured (or default) agent or registers the service if configured to do so. The name resolution interface does not cater for an "on shutdown" pattern so consider this when using Dapr to register services to Consul as it does not deregister services. +On startup the Consul component either validates the connection to the configured (or default) agent or registers the service if configured to do so. Similarly, on shutdown the component will deregister the service if configured to do so. The component resolves target apps by filtering healthy services and looks for a `DAPR_PORT` in the metadata (key is configurable) in order to retrieve the Dapr sidecar port. Consul `service.meta` is used over `service.port` so as to not interfere with existing Consul estates. @@ -46,8 +46,10 @@ The configuration spec is fixed to v1.3.0 of the Consul API | Tags | N | `[]string` | Configures any tags to include if/when registering services | `- "dapr"` | Meta | N | `map[string]string` | Configures any additional metadata to include if/when registering services | `DAPR_METRICS_PORT: "${DAPR_METRICS_PORT}"` | DaprPortMetaKey | N | `string` | The key used for getting the Dapr sidecar port from Consul service metadata during service resolution, it will also be used to set the Dapr sidecar port in metadata during registration. If blank it will default to `DAPR_PORT` | `"DAPR_TO_DAPR_PORT"` -| SelfRegister | N | `bool` | Controls if Dapr will register the service to Consul. The name resolution interface does not cater for an "on shutdown" pattern so please consider this if using Dapr to register services to Consul as it will not deregister services. If blank it will default to `false` | `true` +| SelfRegister | N | `bool` | Controls if Dapr will register the service to consul on startup. If unset it will default to `false` | `true` +| SelfDeregister | N | `bool` | Controls if Dapr will deregister the service from consul on shutdown. If unset it will default to `false` | `true` | AdvancedRegistration | N | [*api.AgentServiceRegistration](https://pkg.go.dev/github.com/hashicorp/consul/api@v1.3.0#AgentServiceRegistration) | Gives full control of service registration through configuration. If configured the component will ignore any configuration of Checks, Tags, Meta and SelfRegister. | See [sample configs](#sample-configurations) +| UseCache | N | `bool` | Configures if Dapr will cache the resolved services in-memory. This is done using consul [blocking queries](https://www.consul.io/api-docs/features/blocking) which can be configured via the QueryOptions configuration. If unset it will default to `false` | `true` ## Sample configurations