I would like to configure a gateway to aggregate multiple individual requests into a single request as this link. However, my use case allows user to create additional services.
A user submit a request:
POST http://gatway_ip/cards/foo
The diagram as follows:
+------------------+ +-----------------+ +-----------------+
| | | | | |
| transactions | | User info | | dynamic info |
| | | | | |
+------------------+ +-----------------+ +-----------------+
| | |
+----------+ +--------+ |
| | |
| | |
+----v-----v---+ |
| | |
| /cards/foo <----------------------------+
| |
+--------------+
|
|
|
+
User
User can start/stop dynamic info on demand. The gateway merges json response from various services. For example:
transactions:
{"amount": 4000}
user info:
{ "name": "foo" }
dynamic info:
{ "wifeName": "bar" }
Gateway responses is:
{
"amount": 4000,
"name": "foo",
"wifeName": "bar"
}
As far as I know:
Is there any solution for a gateway aggregation with dynamic back-end ?
Edited
Work around 1
Refer to NVIDIA configurations for nginx auto-reload, we can take advantages of of Kubernetes ConfigMap, the steps as follows:
backend.json
configuration which is loaded by a lua on event init_by_lua*
(* is block or file)backend.json
and use inotify for monitor ConfigMap changesHowever, this link claims that inotify will not work because shared storage was a fuse filesystem