0

I have a kubernetes cluster with a set of pods and two loadbalancer services. When a incoming requests comes I want to route the request to correct service by checking the query param and making some additional processing on the query param. I know we can route it according to the value of param1 but is it possible to perform additional operations on param and then route it accordingly.

I am planning on using https://docs.solo.io/gloo-edge/latest/.

eg:

/foo?parm1=123

Is possible to get the value 123 and run a script( query a db with that value or convert to binary etc ) to process the value 123 and get a new value and according to it route to a specific service.

Origin
  • 1,182
  • 1
  • 10
  • 25
  • What ingress controller are you using? – Andrew Skorkin Nov 02 '21 at 14:18
  • Using [gloo-edge](https://docs.solo.io/gloo-edge/latest/) – Origin Nov 03 '21 at 04:05
  • The answer depends entirely on what gloo-edge itself can do. Kubernetes Ingress api is pure metadata for actual ingress controller that implement their own solution. It seems to have the basic query param processing, but to run a db query to make routing decisions, you might have to implement your own plugin or extension (https://docs.solo.io/gloo-edge/latest/guides/dev/). – JulioHM Nov 03 '21 at 12:13
  • Thanks @JulioHM Any Idea where i could start from. Didn't much help from the docs. – Origin Nov 05 '21 at 03:54

1 Answers1

0

You can create a WASM filter with your own custom logic. To get you started check how to install and use the wasme cli

And then how to use WASM Filters in Gloo Edge

That said, because you can do this, it doesn't mean that you should. I would discourage adding such type of logic in the API Management (which should merely handle API Management)

Rinor
  • 1,790
  • 13
  • 22