envoyproxy/envoy

Matcher-based route config should support `runtime_fraction`

Open

#24,239 创建于 2022年11月29日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)C++ (5,373 fork)batch import
area/matchinghelp wanted

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

Description: Currently XDS matcher in route configuration context can route based on headers only, but routing based on runtime_fraction is desired for gradual rollouts.

One way to implement is to expose streamId (or randomId) in HttpMatchingData alongside requestHeaders: https://github.com/envoyproxy/envoy/blob/4e40d6ad5f98cd3c86f1398bb8990b1d88bdfe92/envoy/http/filter.h#L1078-L1084

Then add RuntimeFractionMatchInput in addition to HttpRequestHeaderMatchInput, smth like:

message RuntimeMatchInput {
  // Sets input to `true` if runtime key is enabled and `false` otherwise.
  core.v3.RuntimeFractionalPercent runtime_fraction = 1;
}

And allow it as an input source for HTTP route configuration matcher (and maybe others as well, like RBAC, as I assume it also may want to have gradual rollout functionality).

Is it something which is acceptable to add to envoy?

Relevant Links: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_routing.html#routing-via-generic-matching

贡献者指南