-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consul name resolution in-memory cache #3121
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
84001c9
nr_consul_cache squashed commits to resolve dco
a-elsheikh ecd98f0
Update nameresolution/consul/README.md
a-elsheikh 01ed67b
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh 7c7691d
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh 40cbf17
nr_consul_cache refactored to use single routine for watching all ser…
a-elsheikh f1c0804
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh a74ee03
nr_consul_cache disable agent cache query for watcher health service …
a-elsheikh c02778e
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh 673e068
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh dcb6371
Update nameresolution/consul/consul.go
a-elsheikh 8274b6d
Update nameresolution/consul/consul.go
a-elsheikh 88bdaca
Update nameresolution/consul/consul.go
a-elsheikh b74f295
Update nameresolution/consul/watcher.go
a-elsheikh 732bc58
Update nameresolution/consul/watcher.go
a-elsheikh 97b537a
Update nameresolution/consul/watcher.go
a-elsheikh 5f18b8e
Update nameresolution/consul/watcher.go
a-elsheikh b8eb7d5
Update nameresolution/consul/watcher.go
a-elsheikh 74b69a9
merge nr_consul_cache_dco
a-elsheikh 3831d25
use backoff libs, refactor ctx params, some tidy up
a-elsheikh fb854e6
lint fixes
a-elsheikh bdb2f29
remove panic recovers
a-elsheikh b1cbd69
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh 5b0d209
more lint fixes
a-elsheikh 368709f
Merge branch 'nr_consul_cache_dco' of https://github.com/man-group/co…
a-elsheikh 402e2b1
resolve data races in tests
a-elsheikh 0659997
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh 2745d07
💄
ItalyPaleAle bbfb762
added resolver close method for cleanup and deregister
a-elsheikh ff8cc37
fix lint issues
a-elsheikh 7c10a9b
Merge branch 'master' into nr_consul_cache_dco
a-elsheikh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Consul Name Resolution | ||
|
||
The consul name resolution component gives the ability to register and resolve other "daprized" services registered on a consul estate. It is flexible in that it allows for complex to minimal configurations driving the behaviour on init and resolution. | ||
The consul name resolution component gives the ability to register and resolve other "daprized" services registered on a consul estate. It is flexible in that it allows for complex to minimal configurations driving the behavior on init and resolution. | ||
|
||
## How To Use | ||
|
||
|
@@ -35,7 +35,7 @@ spec: | |
``` | ||
|
||
|
||
## Behaviour | ||
## Behavior | ||
|
||
On init the consul component will either validate the connection to the configured (or default) agent or register the service if configured to do so. 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. | ||
|
||
|
@@ -54,9 +54,10 @@ As of writing the configuration spec is fixed to v1.3.0 of the consul api | |
| Tags | `[]string` | Configures any tags to include if/when registering services | | ||
| Meta | `map[string]string` | Configures any additional metadata to include if/when registering services | | ||
| DaprPortMetaKey | `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` | | ||
| SelfRegister | `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. | | ||
| SelfRegister | `bool` | Controls if Dapr will register the service to consul on startup. If unset it will default to `false` | | ||
| SelfDeregister | `bool` | Controls if Dapr will deregister the service from consul on shutdown. If unset it will default to `false` | | ||
| AdvancedRegistration | [*api.AgentServiceRegistration](https://pkg.go.dev/github.com/hashicorp/consul/[email protected]#AgentServiceRegistration) | Gives full control of service registration through configuration. If configured the component will ignore any configuration of Checks, Tags, Meta and SelfRegister. | | ||
|
||
| UseCache | `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` | | ||
## Samples Configurations | ||
|
||
### Basic | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when we tried to do that (to solve #2490 ) this was a bad idea. It did un-register all instances of an app and not just the one that was going offline.
I would prefer if this wasn't even offered as an option, as it can cause confusion to users.
(And with #2490 merged in 1.12, this isn't needed anyways)