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

Dynamic gateway reconfiguration #134

Closed
Artonus opened this issue Mar 31, 2023 · 3 comments · Fixed by #174
Closed

Dynamic gateway reconfiguration #134

Artonus opened this issue Mar 31, 2023 · 3 comments · Fixed by #174
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Artonus
Copy link
Member

Artonus commented Mar 31, 2023

Is it possible to automatically reconfigure the gateway to route the network to the specific NetApps on demand? This would allow us to enable RBAC to the NetApps themselves and expose everything behind a Gateway and enable SSL termination. This would also skip the requirement to enable authentication on the NetApp level.

For example, we could try to redirect the traffic based on the subdomain (netaapX.middleware1.5g-era.eu) or subpath (middleware1.5g-era.eu/netappX) and redirect the traffic to the specific service exposed by a NodePort.

The specific redirection would be applied on the deployment of the Exposed NetApp in the k8s cluster

@Artonus
Copy link
Member Author

Artonus commented Jun 2, 2023

Other reverse proxy providers like YARP provide very useful and clear SDK to automatically reconfigure the Routes during the runtime.

https://github.com/microsoft/reverse-proxy/blob/main/samples/ReverseProxy.Code.Sample/README.md
https://microsoft.github.io/reverse-proxy/articles/config-providers.html

@Artonus
Copy link
Member Author

Artonus commented Jun 2, 2023

I think that we should at least consider changing Ocelot to YARP. The supported functionalities should allow for the same configuration by exchanging only NuGet packages and config files (they have slightly different structure). The benefit of being able to dynamically reconfigure the proxy will return this time in advance as opposed to doing this in Ocelot.

@Artonus Artonus modified the milestones: Research, v0.6 Jun 14, 2023
@Artonus
Copy link
Member Author

Artonus commented Jun 26, 2023

We have managed with @radu-popescu to get the YARP and automatic reconfiguration to work with standard REST requests and WebSockets. The next step is to enable receiving messages from RabbitMQ with the request to reconfigure the gateway. For this, we need these steps to be completed:

  • Extract the /configure endpoint to the new GatewayConfigurationService
  • Prepare a new message contract in Common/MessageContracts named GatewayAddNetAppEntryMessage
  • Take a look at Orchestrator/Handlers and prepare an analogical handler in the OcelotGateway that will call GatewayConfigurationService
  • Configure OcelotGateway to listen to the new GatewayAddNetAppEntryMessage using code like in Orchestrator/ExtensionMethods/ServiceCollectionExtensions/RegisterRabbitMqConsumers
  • Repeat the steps above for the message to delete the existing entry in YARP

@radu-popescu radu-popescu linked a pull request Jun 29, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants