Support stateful session affinity for weighted clusters to support use-cases like canary deployment
#24,741 opened on Jan 3, 2023
Repository metrics
- Stars
- (27,997 stars)
- PR merge metrics
- (Avg merge 8d) (378 merged PRs in 30d)
Description
Title: Support stateful session affinity for weighted clusters to support use-cases like canary deployment
Description: Currently cookie based stateful session affinity is implemented (see https://github.com/envoyproxy/envoy/pull/18207) but it only works within a cluster. When multiple clusters are used for a service and the user would like to maintain session affinity across clusters then it doesn't work.
e.g. client sends a request R1 and Envoy routes it to cluster C1 host C1H1. Envoy inserts a cookie in the response to maintain session affinity to H1. Client copies the cookie value in the next request R2 and because weighted-clusters (canary deployment) is in use, Envoy picks cluster C2 for R2 but the cookie is meaningless for C2 so Envoy picks a new host C2H2 and session affinity is broken. What we want is that Envoy should pick cluster C1 for R2 (because the cookie also has the cluster name encoded in it) and within C1 it should route R2 to C1H1.
[optional Relevant Links:] https://github.com/istio/api/pull/2469#issuecomment-1245067340 https://github.com/istio/api/pull/2469#issuecomment-1246231933 https://github.com/istio/api/pull/2469#issuecomment-1247587910 https://github.com/istio/api/pull/2469#issuecomment-1248422947
CC @wbpcode