In the context of improving an API on Kubernetes, I am considering using a distributed hash table. My API always receives requests to an URL with this scheme:
www.myapi.com/id
Reading the documentation of Istio, it seems pretty direct and easy to get what I want. Indeed, Istio handles a load balancing scheme called ConsistentHashLB. I such a scheme, the service destination is chosen according to a hash computed from several possible fields: HTTP header name, cookie, source IP, and an HTTP query parameter name.
In my case, I would need to compute the hash according to the id associated with the request.
My question is double and conditional:
- Is it possible to read the
idas an HTTP parameter name? - If affirmative, how should I specify the rule in the manifest? (the doc that I have read is not enough clear in this regard).
If negative, some idea? some trick? For example, I am considering adding the id as an HTTP header with `Nginx, but this would add an additional step.