envoyproxy / gateway

Manages Envoy Proxy as a Standalone or Kubernetes-based Application Gateway
https://gateway.envoyproxy.io
Apache License 2.0
1.61k stars 349 forks source link

Add the ability to override only a portion of the spec using Policies #1934

Open arkodg opened 1 year ago

arkodg commented 1 year ago

Description:

With policies such as the ClientTrafficPolicy, a user can target a section within a target e.g. a Listener within a Gateway which applies or overrides the target with the spec of the policy.

Another use case is where a user wants to only override some fields i.e. the top level policy might setup defaults for fields like keep alive but a specific policy for a specific target/section may want to only apply an extra setting such as retries

One way to achieve this is to add a type field within the policy resource which can be set to Replace or Merge, which defaults to Replace (apply entire spec)

[optional Relevant Links:]

Any extra documentation required to understand the issue.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

luvk1412 commented 2 months ago

My use case where i need this: we have a global security policy which have defined cors, each dev can select various predefined security policies for auth, cors and other stuff based on label selectors for there routes. To achieve this, merging would be required in our use case.

arkodg commented 2 months ago

@guicassolato and the Kuadrant team had to solve a similar problem and their solution was a strategy:Merge field more in https://docs.kuadrant.io/0.8.0/architecture/rfcs/0009-defaults-and-overrides/#design-option-strategy-field