Repository navigation
PROVISIONAL: Backend GEP - #4818
Conversation
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
2093034 to
513b54e
Compare
|
Oh c'mon, there was only a little heckling... 😂 I think this looks good! Two things I'd like to see before we merge this one:
Thanks for turning this around so quickly! |
Signed-off-by: Keith Mattix II <keithmattix@microsoft.com>
|
Thanks! /lgtm |
|
|
||
| ## TLDR | ||
|
|
||
| This GEP proposes a new `Backend` resource to address the fact that Service is a mature and stable, if complex API. It is useful to be able to add Gateway-specific behaviors to Service, but previous approaches (like BackendTLSPolicy) have significant limltations, particuarly around discoverability and implementation complexity. |
There was a problem hiding this comment.
I would like to propose a different name choice than Backend for this resource. If I understand correctly, Backend does not replace BackendTLSPolicy yet introduces some ambiguity between the two resources because of the similarity in names. We explicitly chose to use the terms backend and frontend as defined in GEP-2907: TLS Configuration Placement and Terminology
and if we decide to drop that terminology, we'd need to rename a few other resources.
Since this appears to be primarily for egress routing, how about calling it Egress, or something similar?
If it can be used in combination with BackendTLSPolicy, how about BackendConfig, or something similar?
There was a problem hiding this comment.
Backend is actually designed to be more flexible than BackendTLSPolicy and more powerful for every comsumer-oriented use-case. The EndpointSelector mode in the GEP will allow it to decorate internal Service resources too so EgressBackend would actually be too limiting IMO.
There was a problem hiding this comment.
Anything other than just Backend that describes better what this resource does, would be much appreciated.
There was a problem hiding this comment.
Rereading @keithmattix's paragraph here, I can see potential for confusion.
The point of Backend, to my way of thinking, isn't to duplicate or replace BackendTLSPolicy: it's to give us a resource that we control that allows us to describe a routing destination. In other words, it's a thing to use instead of Service in the backend role (as described in GEP-2907). So in my mind, Backend is the correct name since the intention is that a Backend is always filling the backend role.
So BackendTLSPolicy isn't being used as an example of another resource in the same role that Backend is meant to fill -- rather, it's an example of a way in which we attached behavior to Service since we didn't have any other way to describe the backend role. Keith, we should probably spend a little time improving this language...
There was a problem hiding this comment.
Yeah, because this is effectively us saying "We're going to need to add a lot of things to Service, and having a Policy for each is going to be awful, let's use a Service replacement instead", Backend is actually the best name for it to me too.
I agree there's some overlap with BackendTLSPolicy, but that's because there's overlap with the functions they perform. To be honest, I wish we had moved forward with just wrapping Service like this proposal suggests instead of moving forward with a Policy, and I would anticipate that eventually, Backend will grow a copy of the BackendTLSPolicy spec aside from targetRefs, in addition to session persistence, retries, and so on.
Basically, the idea here is that everything we've ever said "man I wish we could just add this to Service", we'll put in Backend instead. And so, because this object will be referenced by backendRefs across many Routes, to me, the name makes sense.
There was a problem hiding this comment.
Yeah makes sense; reworded
|
/lgtm |
|
|
||
| ### As an Application Developer | ||
|
|
||
| > "I want to configure my application to call external APIs (like OpenAI) with specific TLS settings and authentication without creating synthetic Services that expose security risks or affect other applications." |
There was a problem hiding this comment.
I would love to see an additional story here that is not specific to egress gateway but to ingress traffic (eg.: I want to expose my application additional signaling to the Gateway how it should be connecting to it, what timeouts use, etc)
This is the idea, not necessarily the story but we could already map how backend could be used for non-egress cases
There was a problem hiding this comment.
Added a couple; LMK what you think
|
|
||
| ```yaml | ||
| apiVersion: networking.example.com/v1 | ||
| kind: RetryPolicy |
There was a problem hiding this comment.
It is a bit conflicting for me the goal that says about all "enable backend-specific policies", with the proposal of making it better than BackendTLSPolicy and immediately here using RetryPolicy as an example.
Tbh I would expect that policy attachment to a Backend is a last resort, and even filters like retry, session persistence and others become a Backend filter (how to connect to a backend is the goal, right?) other than "now you can apply tls configuration in Backend, but you need to use a policy attachment for retry"
There was a problem hiding this comment.
Fantastic point; updated to discuss inline policy instead with a caveat that policy attachment is still available as a last resort
|
For me, this looks good enough for Provisional, so I'll approve and leave the hold for @rikatz to remove. /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: howardjohn, keithmattix, kflynn, youngnick The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Keith Mattix II <keithmattix2@gmail.com>
|
|
||
| This conflation creates friction in a few notable areas: | ||
|
|
||
| ### External Destination Limitationsr. The Backend resource provides |
There was a problem hiding this comment.
typo (can be fixed on a followup)
There was a problem hiding this comment.
also the title is kinda weird here,, I guess you forgot to remove the "The Backend resource provides"
| └─────────────────────────────────────────────┘ | ||
| ``` | ||
|
|
||
| Existing `Service`-based `backendRef`s in HTTPRoutes continue to work indefinitely. The `Backend` resource is an opt-in addition for users who need Gateway-specific backend configuration. |
There was a problem hiding this comment.
just a clarification: this means that for filters that have a backendRef both services and Backend will work, right? So I can have an ext_auth that uses a Backend or should I use a service? (probably this should be declared on the API of each filter as well, as it may impact how each filter can, for instance use a TLS configuration instead of a BackendTLSPolicy, but also, I wouldn't expect that a filter would need a ratelimit or a backend of type MCP).
Just some loud thinking of something we need to sort out
There was a problem hiding this comment.
Agreed this needs a bit more work to refine and document, not an experimental blocker though.
|
/lgtm Thanks! |
|
/hold cancel Thanks! |
Opening a Provisional version of #4488 at @kflynn's request (and heckling 😉) to follow the proper Gateway API release management processes of having a "what" and "why" GEP in provisional before going into API design.