Is it possible to achieve stickiness for an individual upstream server instead of a subset based on a condition when using subset hashing?
This is my requirement I am using an ingress nginx controller. I have 4 pods in a deployment and I have configured upstream hashing based on a header key(which I pass as a header in the http request), and also enabled subset with size 2. So basically, I have two subsets now, each having two pods. Subset1-->(p1, p2) and Subset2-->(p3, p4)
nginx.ingress.kubernetes.io/upstream-hash-by: "$my_header"
nginx.ingress.kubernetes.io/upstream-hash-by-subset: "true"
nginx.ingress.kubernetes.io/upstream-hash-by-subset-size: 2
I have two requests GET /req1 and GET /req2 which has the same upstream hash key and say both the requests go to the Subset1. But the one request can reach p1 and the other in p2. Is it possible to mandate that if the req1 went to p1, then the second request req2 also should go to the same pod p1? Similarly, if the req1 went to p2, then the second request req2 also should go to the same pod p2?
Session cookies allow stickiness for the subsets, not for the pods within the subset. Is there a way to achieve this?