Skip to content
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

Config providers such as a DNS based destination resolver are unnecessarily duplicative to implement #2154

Open
samsp-msft opened this issue Jun 6, 2023 · 1 comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Milestone

Comments

@samsp-msft
Copy link
Contributor

samsp-msft commented Jun 6, 2023

There are scenarios like #2151 with Docker Swarm where the destination list needs to be dynamically resolved by DNS. This is different from what we support today in Destination configuration - although you can specify the destination host using DNS, it is expecting that to be a single host, and not a collection of hosts that needs to be used as the basis for load balancing.

In addition you want the host resolution to be dynamic, and constantly polling for changes to the DNS records as additional hosts can be added/removed. It could also be tied in with passive health checks, so that in the case of a failure, that can be a signal to poll the dns to see if the host is still listed, and if not what the alternatives are.

In this scenario, the DNS server with the addresses may not be the default for the host, and the DNS api built into .NET just uses the host platform's APIs for DNS resolution. This scenario may justify using a separate dns client such as DnsClient.NET which can be used to talk to the DNS server directly.

A DNS IProxyConfigProvider would implement the Cluster part of configuration and would populate the cluster properties based on an IConfiguration Section, except rather than having each destination explicitly enumerated, it would use DNS to resolve the host list, and poll/listen for dns changes and update the configuration as applicable.

However there are some problems with this concept:

  • IProxyConfigProvider's can't overlap - they can supply unique objects, but they can't add extra info to each other
  • IProxyConfigFilters can adjust config coming from another provider, but they can't invalidate and update configuration
  • ConfigurationConfigProvider is sealed and most of its members are marked as private, so you can't just re-implement the CreateCluster method calling into the sub-routines that will parse out HttpClient, HealthChecks etc from IConfiguration.

We should fix one or all of the above to make this kind of scenario easier to implement.

@samsp-msft samsp-msft added the Type: Idea This issue is a high-level idea for discussion. label Jun 6, 2023
@samsp-msft samsp-msft assigned samsp-msft and unassigned samsp-msft Jun 6, 2023
@samsp-msft samsp-msft changed the title Sample needed: DNS based destination resolver Config providers such as a DNS based destination resolver are unnecessarily duplicative to implement Jun 6, 2023
@samsp-msft
Copy link
Contributor Author

#1698 covers some of this by exposing the methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Projects
None yet
Development

No branches or pull requests

1 participant