I have a Kubernetes cluster deployed with an nginx reverse proxy.
Now I have deployed with a helm a chart one my services with all its resources and defined an ingress rule for nginx.
So far, this works nicely.
However, I am having several pods in my deployment and I want that the same URL call goes to the same pod.
For instance, consider the following:
1. https://my-domain.com/this/is/abcd/
2. https://my-domain.com/this/is/abcd/and/so/on
3. https://my-domain.com/this/is/defg/
4. https://my-domain.com/this/is/defg/here
Now these abcd and defg parts of the domain should be relevant, i.e., the first two calls should go to same pod, no matter from which user, and the last two calls should go to the same pod.
I know there is some config like nginx.ingress.kubernetes.io/upstream-hash-by:, but I do not know how to use it to make this work here.
Hence, could you help me with an example how to make it work here? Also, do you know whether auto-scaling will cause an issue, when there are suddenly more or less pods? Would the hashing approach still work well here?