envoyproxy/envoy

Support stateful session affinity for weighted clusters to support use-cases like canary deployment

Open

#24,741 建立於 2023年1月3日

在 GitHub 查看
 (8 留言) (0 反應) (1 負責人)C++ (5,373 fork)batch import
area/http_filterenhancementhelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

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

貢獻者指南