PolicyAttachment is complex #1715
Replies: 7 comments 13 replies
-
Reporting what Policy is in effect on a Route is also not well defined, so more complex UX and implementation details there (see discussion started here #1531) |
Beta Was this translation helpful? Give feedback.
-
I've been thinking about this a lot as well, and would like to find ways to make this better. It seems like we're already starting to explore a few paths forward:
Open to additional approaches here, but if we were to move forward with all of these directions, would it help resolve some of the complexity issues? |
Beta Was this translation helpful? Give feedback.
-
@keithmattix this post seems to be suggesting that Gateway API is leaning on |
Beta Was this translation helpful? Give feedback.
-
We tried to experiment with
We ended up not using it due to the following reasons
More details in envoyproxy/gateway#675 |
Beta Was this translation helpful? Give feedback.
-
I'd add that it is also not clear when to use a Policy or a Custom filter. More use case examples (for an advanced proxy):
|
Beta Was this translation helpful? Give feedback.
-
This is on me, I've had the PR clarifying about Policy Attachment vs more generic metaresources pending for a long time. Policy attachment is definitely not a completed idea. It's lacking definition around the exact things that @arkodg and @sunjayBhatia mentioned: the merge behavior and how it should interact with other things like custom filters. (I updated the wording about custom filters in #1565, but that's not merged yet.) Policy Attachment is directly designed to handle use cases like timeouts, because when we were building Contour, every time we added a timeout to HTTPProxy, soon after we got a request from a proxy admin for them to have the ability to either default or override that timeout. I think the same will apply here, even if we add official fields for timeouts to HTTPRoute (for example), Gateway admins will want to do things like say "no infinite request timeouts", since that's really bad when you're running a shared proxy (connection table starvation produces difficult-to-troubleshoot symptoms). Defaults are also intended to be used to help remove boilerplate, because many fields have very deployment-dependent defaults. Many Envoy timeouts are only enabled if you specify a value, because they can produce unexpected behavior when you set them, even if they are useful in some cases. A great example here is the HTTP max_connection_duration - this is used to ensure a maximum lifetime for any connection, which is useful in some cases, but really sucks in others (like long-running gRPC connections). In terms of the proliferation of CRDs - I don't see many ways around this, we really only have a few options:
I'd argue that in the GAMMA use case, although there's not an obvious hierarchy like GatewayClass -> Gateway -> Route, there is an implied hierarchy that would probably be useful to have overrides and defaults available at: Cluster -> Namespace -> Service. It seems likely to me that people would, for example, want to say "no infinite client request timeouts allowed in this cluster", or "all Services in this namespace should default to a longer request timeout". tl;dr I agree that Policy Attachment is complex, but it's solving a complex problem. I welcome further suggestions for simplifying it. |
Beta Was this translation helpful? Give feedback.
-
I think between Policy Attachment update in #1565 (hopefully to be merged soon), and the TimeoutPolicy in #1742, we should be clarifying Policy Attachment a lot. Once those are done, does everyone watching this feel like we've done enough to mark this as "answered"? |
Beta Was this translation helpful? Give feedback.
-
Context: This was brought up during a GAMMA meeting and subsequently raised during a Gateway API community meeting.
PolicyAttachment is one of the most powerful yet intimidating parts of the Gateway API spec. While it allows the spec's fundamental resources (e.g. xRoutes, Gateways) to avoid bloat, the mechanism itself is burdensome for implementations and users alike.
CRD Proliferation
If an implementation wants to expose some data plane specific configuration (e.g. timeouts, h2 settings, etc.), they must commit to creating and maintaining a new CRD (possibly per config domain). At that point, all of the headache around CRD versioning, maintenance, and support kick in. This isn't typically desirable, and many ingress controllers and meshes alike have received negative feedback from users about numerous CRDs.
Defaults and Overrides
The defaults and overrides system of policy attachment is a powerful mechanism to enable the multi-persona capabilities of the Gateway API. However, it's a lot of mental capital for a user to consider all of the interactions between different levels of defaults + overrides if they just want to configure a timeout or set a TCP keepalive. Furthermore, for GAMMA implementations, much of the hierarchy is unnecessary since, in the draft GAMMA spec, there's no listeners, gateways, or gatewayclasses at play.
What are other's thoughts on PolicyAttachment? Should it be changed? Is there another metaresource that should be created?
Beta Was this translation helpful? Give feedback.
All reactions