Repository navigation
Replies: 2 comments 3 replies
|
Thanks for this, I've been thinking about this for some time already, and find it pretty much needed for OpenChoreo to properly cover advanced deployment strategies and complex env topologies. A few things I'd add to keep in mind for the future low-level design:
Also for the |
|
Thanks @NomadXD for opening this, and @Pinguladora for the careful review. As part of Agent as a first-class entity in OpenChoreo, I've been thinking about bringing MCP and A2A as endpoint types (#4927). The following ideas are still experimental, at least in my head :) The goal is to widen the conversation, before we go deeper. On the first-class I think we should call it the
In Backstage, every Endpoint shows up as an Endpoint. That's a new kind, added through a catalog module the same way Backstage added With the above definition:
@Pinguladora, this partly departs from keeping Endpoint routing-only. I agree on keeping product concerns out. But for MCP and A2A, the contract and the address are hard to pull apart. An A2A Agent Card lists the agent's skills and the URLs to reach it in one document. So I'd keep the contract on the Endpoint as an optional field, and leave everything productized to API managers. API control planes can be installed onto OpenChoreo as modules, The responsibilities split cleanly, OpenChoreo stays the record of what exists, who owns it, and which contract and upstream each environment runs. The API manager owns plans, subscriptions and its portal. Each Endpoint's status records the managed reference per environment. The Backstage API page links to the matching entity in the API manager. "Who may expose a service" becomes a publish permission on the Endpoint. An OpenChoreo Endpoint is a stable, named point of access to a Component, a Resource, an Agent (coming soon) or an external service, with a protocol, an optional contract, and a policy for who may reach it, decoupling consumers from whatever serves it in each environment. This is very similar to a low-level K8s Service abstraction. Similarly we need to define what a backend is. I know it is obvious, but It is worth mentioning, IMO. A backend is whatever actually answers the traffic sent to an Endpoint: a Component’s workload endpoint (optionally pinned to a release line), a Resource’s endpoint, or an external address that OpenChoreo does not run. We don't have resource endpoints yet. That is something we can consider adding. A resource can have optional endpoints, IMO. @Mirage20, WDYT? I would not start with label-based filtering to identify backends. You need to declare them explicitly. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Towards a first-class Endpoint abstraction
Related Discussions:
Context
Today,
HTTPRoutegeneration is templated directly inside eachComponentType, rendered once per(Component, Environment)binding. That's a good default: declaring aWorkloadendpoint with a visibility is enough to get it exposed: one step, no separate routing configuration. But this default carries a set of opinions baked into the platform that are worth surfacing and discussing on their own terms, before converging on any particular fix:We've hardcoded an invoke-URL resolution strategy, and opinionated the endpoint model along with it: The platform assumes an endpoint maps to exactly one
HTTPRoute, and requires an endpoint-name and visibility label on thatHTTPRouteso invoke URLs can be resolved back out of it at runtime. That's one specific Gateway API usage pattern among many, and it forecloses on users who want to template other Gateway API patterns for their own endpoints.The ownership model doesn't let two components share a route: A rendered
HTTPRouteis owned exclusively by the component that rendered it. Advanced routing capabilities like weight-based routing for canary releases need two components (or, under Release Lines, two release lines of the same component) to share a singleHTTPRoute, and nothing in the current model lets that happen. This is needed for capabilities like Progressive Delivery and the version-based routing Release Lines names as a requirement. It isn't a Gateway API–specific gap either: even an ordinary traffic split done via a service mesh runs into the same shape of problem, since every mesh's own traffic-split construct (Cilium'sCiliumEnvoyConfig, Istio'sVirtualService, Gateway API GAMMA) declares a split as a single, shared entity rather than something two independent owners can each contribute a piece of.One-step build, deploy, and expose is convenient, but its practicality in real enterprise use is worth questioning: It's a nice property for demos and getting-started flows, but a seasoned platform user usually wants to deploy first, confirm the workload actually behaves, and only then expose it: a two-step flow that's arguably more natural. It's also a real risk for a first-time user: someone with no idea what endpoint visibility means can expose a service without the UX carrying any of the weight that action deserves.
OpenAPI spec drift is a real-world problem, not a hypothetical one: Keeping an OpenAPI spec in the source repo, synced with the code it describes, reads well on paper. In practice it may hold for the first few weeks and then drift, and it keeps drifting from there. This is common enough that API management practice already treats the spec as a separately maintained artifact, an API product the APIM vendor layers its own extensions onto, rather than something continuously derived from source.
Exposing a service isn't always the developer's call: Some organizations restrict who may expose a service to a dedicated role (an admin, or an API publisher) separate from the developer who builds it. Endpoint visibility as a plain field on
Workloadhands that authority to the developer implicitly, with no way to separate it out. This is an extension of point 3, and a first-classEndpointconcept is also the natural place to fold this into OpenChoreo's RBAC model properly, rather than leaving it as a UX concern alone.This is meant as a high-level starting point for discussion, not a finished design. The rest of this document sketches one possible direction,
EndpointType/Endpointas pluggable, shareable first-class CRDs, but the concerns above are worth discussing in their own right before converging on a specific shape.Goals
EndpointType/ClusterEndpointType(platform-engineer-authored, mirroringComponentType'sresourcestemplating with CEL) andEndpoint(developer/operator-facing instance) as first-class CRDs, following OpenChoreo's existingType → Instance → immutable Release → environment Bindingpattern (already used twice:ComponentTypefamily, and proposed again for infrastructure in #3245'sResourceTypefamily).HTTPRoute, OpenShiftRoute,Ingress, or others) fromComponentType, selectable per data plane the same way gateway implementations already are.Endpoint's render lifecycle above a single binding. This is needed to support advanced traffic routing capabilities from the Kubernetes Gateway API, and to make OpenChoreo more flexible and easier to adopt for different use cases.HTTPRouteorIngressdirectly inside aComponentType, exactly as today; that support stays available unchanged. The only change is that invoke-URL resolution gets extended to understand additional route kinds, instead of assuming the single hardcodedHTTPRoutepattern it does today.Non-Goals
ComponentType/Traittemplating engine.EndpointTypereuses the exact same CEL/template mechanism (resources,includeWhen,forEach) rather than inventing a new one.HTTPRoutedirectly inside aComponentType. Nothing stops a platform engineer from continuing to do so; this proposal doesn't take that away.Impact
EndpointType,ClusterEndpointType,Endpoint(and, if the immutable-snapshot pattern is followed consistently,EndpointRelease/EndpointBindingmirroringComponentRelease/ReleaseBinding. We can decide on the specifics as we iterate on this proposal at some later point).ComponentTypes emitHTTPRoutedirectly today. That behavior should remain the implicit default when aWorkloadendpoint names noEndpointType: existing components must keep working with zero migration.ReleaseBinding. AnEndpointspanning multiple release lines needs a render pass scoped above that, most likely alongside the project-level(Cluster)ProjectTypepipeline (internal/pipeline/project), not the per-component one.Design
Two orthogonal concerns
It's worth stating explicitly, since it's easy to conflate: pluggable object kind and shared ownership across bindings are independent design axes.
Ingress, OpenShiftRoute, or even vendor-specific API gateway routes) beyond theHTTPRoutethatComponentTypetemplates hardcode today.Endpointa separate lifecycle from any single binding, which is what a wide range of use cases need: traffic splitting, Progressive Delivery, Release Lines, and similar.The Service/Deployment analogy
The mental model worth envisioning this against:
Endpointshould relate toComponent/ReleaseLinethe way a KubernetesServicerelates toDeployment. AServicedoesn't own the Pods it fans out to; it selects them by label, and can fan out across replicas belonging to multipleDeployments at once if their labels match its selector.Endpointshould work the sameway: a separate abstraction that fans out traffic across whichever backends match its
backendRefs/backendSelectors, rather than being owned by any singleComponentorReleaseLine. That's what makes Progressive Delivery, Release Lines, and general traffic splitting between two components all instances of one underlying capability, instead of three separate features.flowchart LR subgraph K8s["Kubernetes"] SVC["Service<br/>(label selector)"] --> D1P1["Deployment A<br/>replica"] SVC --> D1P2["Deployment A<br/>replica"] SVC --> D2P1["Deployment B<br/>replica"] end subgraph OC1["OpenChoreo: Release Lines"] EP1["Endpoint<br/>(backendRefs)"] --> RL1["Component: orders<br/>ReleaseLine: main"] EP1 --> RL2["Component: orders<br/>ReleaseLine: canary"] end subgraph OC2["OpenChoreo: two components"] EP2["Endpoint<br/>(backendSelectors)"] --> C1["Component: orders-v1"] EP2 --> C2["Component: orders-v2"] endShape
How much goes into the shape vs. parameters
Not everything about an endpoint needs to be a first-class field on
Endpoint/EndpointType. A field likesecurity(TLS, authentication) could go either way: baked directly intoEndpoint.specas part of the shape everyEndpointTypeimplementation understands, or left out of the shape entirely and exposed instead throughEndpointType.spec.parameters: a platform engineer's own CEL-templated field, the same wayComponentTypealready lets platform engineers define their ownparameters.openAPIV3Schematoday. The fewer fields we bake into the shape, the more eachEndpointTypecan differ from the next; the more we bake in, the more consistency users get across gateway vendors at the cost of flexibility. Where that line sits, field by field, is worth deciding deliberately as this design continues rather than defaulting one way or the other.Next Steps
This is not meant to be a concrete proposal in any way. It's meant to lay out the high-level idea and get a discussion started. If it's worth exploring further, a more detailed proposal with additional architectural and implementation specifics can follow.
All reactions