Replies: 3 comments 16 replies
-
My 2c (which is not aligned with the current API, fwiw), is
|
Beta Was this translation helpful? Give feedback.
-
i agree there should only be one way of doing things. it will quickly get out of hand if we adopt separate conventions across implementations. one of the things that's nice about having extension refs be inlined inside the Route/Listener/Gateway is that they're able to indicate to the controller the intent to attach a policy by the config author. this prevents ambiguities from arising during translation (for example when a route is present in the controller's cache but the policy is not). this is the major advantage i see to having policy refs be specified directly within the route - the controller is aware when a policy is intended to be attached but is unavailable. imo combining route delegation (the ability to inherit policies hierarchically) and specifying extension ref at the GW/Route/Listener level handles both the cases: where you want to ensure a config gets applied across a set of routes without each route needing to explicitly opt in, as well as ensuring that routes are never unintentionally served without the intended set of policies that impact how they're served. there are still benefits to putting the target ref inside of the policy rather than having them on the individual route rules but i think it will be difficult to move in this direction as it provides a completely different way of accomplishing the same config from what's there today. a middle ground could be achieved where you specify a single 'meta-policy', attach it to an extensionRef placed at the root of the route's or if we were to decide not to add extensionRef to the root level of the route spec, we can use delegation where you always have a root route that selects a meta policy. the meta policy can then use label selectors to dynamically apply default policies to individual rules written in delegated route tables. note that in this model it is essential that delegation is able to select child routes via labels, otherwise the system cannot be made self service. without relying on delegation+references, it will be cumbersome or maybe impossible to use the current api (filters/extension refs on the route rule) in order to enable config defaults and overrides across routes or rules (since using filters, every route would essentially have to opt-in to policy). i can follow this up with some examples but i wanted to contribute these thoughts to the discussion first |
Beta Was this translation helpful? Give feedback.
-
This discussion seems to imply both policies (or metaresources) and filters are ways to provide custom behavior or extensions. The doc for HTTPRouteFilter clearly states that "HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle." which means adding custom behavior to request/response processing. However GEP-713 states that "A Policy Attachment can affect specific settings across ...one object ... or objects in a hierarchy" and does not talk about custom behavior or processing steps. For metaresource it says "A Kubernetes object that augments the behavior of an object in a standard way is called a Metaresource." I am trying to differentiate between only affecting settings (i.e. properties or attributes) of an object vs affecting behavior or processing steps related to an object such as processing of a request by an HTTPRoute. So my questions are :
|
Beta Was this translation helpful? Give feedback.
-
Warning: This discussion may veer into the territory of extensions vs policy attachment again, but the intent is to narrow the scope specifically around Gateway extensions for the moment.
Summary
The
HTTPRouteRule
andHTTPRouteBackendRef
both support lists of filters which containextensionRefs
. TheseextensionRefs
allow implementations of the Gateway API to provide custom behavior which users can enable on those specific objects by targeting the resource in question. However, right now these extensions are very limited. They only allow attachment in these 2 places. This raises a number of issues in my mind:HTTPRouteRule
?The current answer to this question seems to be policy attachment, but there also seems to be appetite for extension points elsewhere in the API as can be seen by @robscott's comment.
Policy attachment seems like the perfect solution to apply policies which cannot have extensions refs due to lack of ownership by the Gateway API community. For example, services. However, the current existence of extension refs imply multiple ways to "skin a cat" which may lead to confusion down the road.
I absolutely understand the power of policy attachment in this case because it allows for attachment at any level without the Gateway API needing to specify extension points at EVERY level of it's API, but this contradiction already exists and so I'm wondering if there's appetite for at least Gateway/Listener level extensionRefs in the meantime to allow consistency of extension between the
HTTPRoute
and theGateway
.I'm happy to add examples and use-cases below if this discussion gets some traction.
Beta Was this translation helpful? Give feedback.
All reactions