Skip to content

Use reverse proxy for simulation websocket traffic

Alejo Carballude requested to merge feature/gloo into develop

Related tasks

Context

A websocket server runs inside each simulation server instance. Currently, each websocket server has to be explicitly exposed to the Internet to allow clients to connect. To expose the server, a Kubernetes service is created and connected to a load balancer that's in charge of getting traffic from the Internet to the service.

We have been using an AWS load balancer to direct Internet traffic to websocket servers. AWS load balancers are able to discover specific services in the cluster to allow redirecting traffic to them. The problem is that these load balancers are limited to 1000 targets, which is under the expected amount we need.

In addition, the component that we are using to configure the load balancers is quite fragile. A single invalid rule stops new updates from propagating to the load balancer, and causes all launched simulations to fail.

Change

The websocket redirection is now being handled by a reverse proxy that's hosted in the cluster. The reverse proxy is a Gloo Gateway. An AWS load balancer is still in place to expose the reverse proxy to the Internet, but it only needs to direct traffic to a single target, which keeps the number of targets constant and will not be affected by the number of simulations being routed to.

Cloudsim now creates Gloo routes when launching simulation instances.

Other information

Additional documentation

Edited by Alejo Carballude

Merge request reports