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

Proxy is supplied as a pre-built docker image #247

Open
Tratcher opened this issue Jun 16, 2020 · 16 comments
Open

Proxy is supplied as a pre-built docker image #247

Tratcher opened this issue Jun 16, 2020 · 16 comments
Labels
Priority:2 Used for divisional .NET planning Type: Idea This issue is a high-level idea for discussion. User Story Used for divisional .NET planning
Milestone

Comments

@Tratcher
Copy link
Member

Tratcher commented Jun 16, 2020

We've proposed shipping YARP in three formats:

The pre-built app should:

  • Read from a config file
  • Cover basic scenarios
  • Support a variety of platforms

Scenarios

Config

The library already supports loading routes from a config file. However, an app will need to expose additional config for the scenarios described above.

Platforms

  • Windows, Mac, Linux
  • Builds for both runtime dependent and standalone (servicing?)

Acquisition

  • Microsoft download center?
@Tratcher Tratcher added the Type: Idea This issue is a high-level idea for discussion. label Jun 16, 2020
@b0
Copy link

b0 commented Jun 18, 2020

Is there use for a docker image with this pre-built application exe as another shipping format?

@Tratcher
Copy link
Member Author

@b0 as an ingress controller (#200) or as a simplified deployment model?

Packaging this exe up into a pre-built container would be one step to consider beyond the development of the exe itself (e.g. additional work item). I'd primarily wonder about the configuration story in that case.

@b0
Copy link

b0 commented Jun 18, 2020

@Tratcher I find both usable. It's possible to host containers in Azure App Service too(OpenShift, etc...) so a plain docker image could have value. As of configuration story for that kind of container I find docker volumes and a plain json file YARP already support more then sufficient... Hope this have sense for you?

@Tratcher
Copy link
Member Author

@b0 Good to know. We may split containerizing out into a separate issue when we get around to working on the exe scenario.

@samsp-msft
Copy link
Contributor

Is this about having a pre-built container image for YARP, or having a docker file so that customers can build their own images?
For configuration does the config file have to live next to the binary, or is there a way that config can be directed to be loaded from another well-known location that could then be mapped to being stored elsewhere by docker.

@b0
Copy link

b0 commented Jun 19, 2020

It's about pre-built image with everything ready for running. Configuration file(routes, destinations, etc...) doesn't need to be inside image nor next to binary but can be provided via docker volumes - pretty standard way of doing things. Volumes are the way to load config from other location and not keeping it next to binary.

@samsp-msft samsp-msft added this to the 1.0.0 milestone Jun 23, 2020
@samsp-msft samsp-msft changed the title Create a proxy app Create a proxy docker image Jun 23, 2020
@samsp-msft
Copy link
Contributor

From the comments it seems like creating a docker image is also popular. As this issue had the comments, I have changed this to be creating a docker image, and forked a new issue #261 to track the stand alone exe.

@samsp-msft samsp-msft added the User Story Used for divisional .NET planning label Oct 21, 2020
@samsp-msft samsp-msft changed the title Create a proxy docker image Proxy is supplied as a pre-built docker image Oct 22, 2020
@samsp-msft samsp-msft added the Priority:2 Used for divisional .NET planning label Jan 20, 2021
@karelz karelz modified the milestones: YARP 1.0.0, Backlog Mar 29, 2021
@lukemcdo
Copy link

This would just be a small layer on top of the existing ASP.NET images, right?

@Tratcher
Copy link
Member Author

@lukemcdo correct, just adding the YARP library and a standard Startup + config.

@damianog
Copy link

damianog commented May 30, 2021

@Tratcher is it possible to configure the endopoint to map the reverse proxy on the standard ports 80,443 and route request from another port like 81 to a classic MVC controller route?

.MapWhen(p => p.Request.Host.Port == 81, etc.. 

What I want to do is a yarp service with a simple mvc backend with authentication from which to configure routes and clusters and save them on a static file or a sqlite db.

Thanks in advance.

@Tratcher
Copy link
Member Author

Tratcher commented Jun 1, 2021

@damianog that seems unrelated to this topic, please start a new discussion thread.

I think you could do this with Host based routing, something like [Host("*:81")]
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-5.0#host-matching-in-routes-with-requirehost

@PureKrome
Copy link

Hi Team - with YARP 1.0 now RTM'd, is there plans to review this issue (an official docker image) for vNext ?

Sure, the docker image can only service a number of scenario's, but it would be a pretty large suite, IMO. Could really help with competing with other RP's.

@samsp-msft
Copy link
Contributor

We can, but I don't think that really shows off the benefits of YARP - being able to customize the way it handles the non-simple cases - such as authentication, dynamic config etc. If you don't need that, you won't get a great deal of benefit out of YARP compared to other RPs.

@PureKrome
Copy link

PureKrome commented Nov 10, 2021

@samsp-msft : ok, maybe I could ask the question in another way. What's the most benefit one person could get from a docker'd instance of YARP via providing a config file? Surely an Out-of-the-box with a config file docker-instance can handle a large common number of scenario's?

Like for example, I want to use YARP instead of Traefik:

  • Given these routes, direct them to these backend destination/server(s)/"clusters".
  • Log metrics to this-metrics-server (so I can see stuff)
  • expose the dashboard so I can see stuff

and this is (i would have thought) a pretty common entry level scenario.

Am I misunderstanding what YARP is, then?

@samsp-msft
Copy link
Contributor

Once we had enabled the customization path, and started going down that road, it meant we made choices where we favored code over config. This is a proxy being developed by a developer platform team - most of our experience is around creating APIs and developer infrastructure such as ASP.NET - and so that has a strong influence around how we approach the problems.

This approach has resonated with service teams at Microsoft who are consuming YARP - they all needed something a little off the beaten path provided by other reverse proxies - and each is different.

For example you mention logging of metrics. In YARP we delivered that as an API together with a couple of samples for how to consume the metrics. For example we don't have Prometheus support built-in, but show how to do it via the sample. We didn't want to try and pick a winner, or force metrics and logging tools to perform unnatural acts to be able to scrape the info that they need. We think its much cleaner for developers to do the (usually simple) wire up between YARPs API and the APIs for their specific metrics/logging tools.

These design choices mean I don't think you'll have as good as an experience with an out of the box YARP container image today as you may have with other proxies. We would need to build more directly into YARP, and provide configuration knobs for controlling that functionality. This may be a direction we can take, but we'd like to see additional feedback asking for it so we can prioritize it.

In the shorter term we should probably make it easier for you to create a your own YARP container images with .NET etc by supplying compose files.

@samsp-msft samsp-msft moved this to 📋 Backlog in YARP 2.x Jun 9, 2022
@dpbevin
Copy link
Contributor

dpbevin commented Jun 18, 2022

Does this feature cover vanilla YARP and the Kubernetes YARP?

I'd like to see an image for the Kubernetes flavoured YARP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Used for divisional .NET planning Type: Idea This issue is a high-level idea for discussion. User Story Used for divisional .NET planning
Projects
Status: 📋 Backlog
Development

No branches or pull requests

9 participants