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

Formalize the concept of a configuration server #1710

Open
samsp-msft opened this issue May 10, 2022 · 1 comment
Open

Formalize the concept of a configuration server #1710

samsp-msft opened this issue May 10, 2022 · 1 comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Milestone

Comments

@samsp-msft
Copy link
Contributor

samsp-msft commented May 10, 2022

What should we add or change to make your life better?

In the scenarios where multiple YARP instances are being used, you need to manage the configuration for each instance independently, which can be a bunch of work.
The model when integrating YARP with a different process management system such as k8s or Service Fabric, is to typically have a process that takes their model, and maps it over to YARP's, which is then serialized and given to the YARP process.

Why is this important to you?

While you can roll your own today, we should build the capability into YARP for proxy instances to be able to talk to a configuration server and make the server easy to operate.

Proposal

Using a configuration server in a YARP proxy instance, should be as simple as pointing YARP at the configuration endpoint

 services.AddReverseProxy()
    .UseConfigServer("https://my.config.server/YarpConfig", sharedKey);

To create the config server should be very similar to how you configure YARP today. You should be able to use exactly the same configuration files, custom providers, filters etc that you would with a local instance.

services.AddReverseProxyConfigServer(sharedKey)
    .LoadFromConfig(Configuration.GetSection("ReverseProxy"))

You then expose an endpoint for the proxy instances to talk to using:

public void Configure(IApplicationBuilder app, IProxyStateLookup lookup)
{
    app.UseRouting();
    app.UseEndpoints(endpoints =>
    {
        endpoints.MapReverseProxyConfig("/YarpConfig");
    });
}

This will create an endpoint that the proxy will listen on. The endpoint will provide APIs for the configuration data, and a way that the proxy instances can listen for change notifications. Making a change to configuration on the config server should notify each of the clients and then they can pull the new configuration down.

There needs to be a way to authenticate the proxies, probably using some form of shared secret, that is then hashed and sent over the wire.

Dynamic destination registration

One way this could be extended would be for there to be a way for destinations to register and unregister themselves against specific clusters.

@samsp-msft samsp-msft added the Type: Idea This issue is a high-level idea for discussion. label May 10, 2022
@karelz karelz added this to the YARP 2.0.0 milestone May 17, 2022
@samsp-msft samsp-msft moved this to 📋 Backlog in YARP 2.x Jun 9, 2022
@adityamandaleeka adityamandaleeka modified the milestones: YARP 2.0.0, YARP 2.x Jan 9, 2023
@adityamandaleeka adityamandaleeka modified the milestones: YARP 2.1, YARP 2.x Nov 7, 2023
@thompson-tomo
Copy link

For efficiency I feel that this should be achieved by Aspire (dotnet/aspire#3985) so that other projects/app can benefit.

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
Status: 📋 Backlog
Development

No branches or pull requests

4 participants