[Feature] Gateway-controller management resources as WSO2 CRDs in Gateway Operator (APIGateway path) #1808
CrowleyRajapakse
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Extend the gateway-operator so
APIGateway-backed flows can reconcile more thanRestApi. Each new CRD mirrors a resource exposed by the gateway-controller management API (OpenAPI ingateway/gateway-controller/api/management-openapi.yaml; base URL prefix/api/management/v0.9).In scope:
LlmProvider,LlmProviderTemplate,LlmProxy— AI provider/template/proxy configuration (YAML payloads aligned with gateway-controller schemas).Mcp(MCP proxy) — MCP proxy runtime configuration.WebSubApi— WebSub/hub-oriented API payloads.Secret— platform secrets stored by gateway-controller (not a replacement for core KubernetesSecretobjects; optionalvalueFromto read from core Secrets when populating payloads).Certificate— certificate upload; gateway assigns aid(UUID); operator persistsstatus.idafter first sync.ApiKey— nested under a parent resource (RestApi,LlmProvider,LlmProxy, orWebSubApi) viaspec.parentRef; URLs look like/…/api-keys/….SubscriptionPlanandSubscription— quota/billing-aligned objects; gateway assignsid; operator keepsstatus.idfor updates and deletes.Out of scope (unchanged):
gateway.networking.k8s.ioGateway,HTTPRoute,APIPolicyreconcilers (k8s_gateway_*,httproute_*) are not extended here. Same split asGITHUB_DISCUSSION_GATEWAY_API.mdvsRestApi; this proposal isAPIGateway+/api/management/v0.9only.Problem statement
Today only
RestApiis a first-class WSO2 CR that the operator syncs to gateway-controller (POST/PUT/DELETEunder/rest-apis/…). Operators who deploy LLM routers, MCP proxies, WebSub APIs, platform secrets, certificates, API keys, and subscriptions currently apply those configs outside Kubernetes (manual REST, Helm hooks, CI) or duplicate logic. Bringing them under the same selection, retry, status, and finalizer semantics asRestApireduces drift and makes GitOps coherent.Who is this for?
RestApiworkloads.APIGatewaywithAPISelector(cluster / namespaces / labels) who expect new resource types to follow the same gateway binding rules asRestApi.Why does this matter?
Programmed-style conditions, and GatewayRegistry lookup mirrorrestapi_controller.gobehaviour.GITHUB_DISCUSSION_GATEWAY_API.md) stays orthogonal to thisAPIGateway-centric extension.Use cases
LlmProviderCR; operatorPOST/PUTto/llm-providers/{handle}.McpCR →/mcp-proxies/{handle}.CertificateCR; after create,status.ididentifies the uploaded cert forPUT/DELETE.SecretCR under gateway-controller management/secrets/…; optionalvalueFromto pull bytes from coreSecret.RestApior LLM resourceApiKeywithspec.parentRef(kind,name); REST path nests under parent.SubscriptionPlan+SubscriptionCRs; persist gatewayidonstatus.Goals (technical)
APIGatewayselection parity — New kinds useregistry.GatewayRegistry.FindMatchingGateways(namespace, labels)the same wayRestApidoes (seeAPISelectoronAPIGateway.spec).gateway/gateway-controller/pkg/api/management/generated.go(*ConfigData, request DTOs). Polymorphic or schemaless fragments useruntime.RawExtensionwhere needed (similar spirit toPolicy.paramsonRestApi).valueFrom.secretKeyRefresolving to plaintext beforePOST/PUT.Certificate,SubscriptionPlan,Subscription: persist returnedidinstatusso subsequent reconcile uses/{id}paths.ApiKeyCR carriesspec.parentRef; controller validates parent existence and prefixes REST paths (rest-apis,llm-providers,llm-proxies,websub-apis).Prerequisites (cluster and assumptions)
APIGateway(or equivalent registry population as today forRestApi).Servicethe operator resolves (same endpoint resolution semantics asRestApitoday).getonSecretwherevervalueFromis used.Not required: Installing Kubernetes Gateway API CRDs (
GITHUB_DISCUSSION_GATEWAY_API.md) solely for these WSO2 CRDs.Gateway selection (
APIGatewayand labels)Behaviour matches
RestApitoday:spec.apiSelectoronAPIGatewaygateway_registry.go).Reconciler behaviour (high level)
APIGateway(enqueue when gateways change selection, same pattern asrestapi_controller.goenqueue from gateway events).GetAuthSettingsForRegistryGatewaypattern asRestApi).apiVersion/kind/metadata/speckinds where the management API expects it; JSON for subscriptions where OpenAPI specifies JSON-only).GET) where supported →POSTorPUT;DELETEon CR removal.APITracker-style in-memory semantics asRestApi(factored toward a generic helper implementation-side).status: conditions (Accepted,Programmed) analogous toRestApi; extra fieldsstatus.idfor UUID-backed resources.Nested
ApiKeyparentsparentRef.kind(planned)RestApi/rest-apis/{parent}LlmProvider/llm-providers/{parent}LlmProxy/llm-proxies/{parent}WebSubApi/websub-apis/{parent}Child path suffix:
/api-keys; key by API keyname/handle.RBAC
Per-kind rules extend the operator RBAC bundle: verbs on each new
gateway.api-platform.wso2.complural resource (get,list,watch,update,patch), subresourcesstatusandfinalizers, and coresecretsgetwhenvalueFromresolution is implemented. Consolidated inconfig/rbac/role.yamland propagated to the Helmclusterrole(same rollout model asRestApi).Coexistence
RestApiand new kinds can share a namespace;APIGatewayselection applies per CR type independently (each reconciler filters with the sameFindMatchingGatewaysinputs).Gateway/HTTPRouteworkloads do not automatically create these CRs. The Gateway API Discussion (GITHUB_DISCUSSION_GATEWAY_API.md) coversHTTPRoute→RestApi‑equivalent payloads on/rest-apisonly for now. Driving LLM/MCP/etc. CRs fromHTTPRoutewould need a separate design.MVP limitations
LlmProviderbeforeLlmProxyreferences it) must be enforced by GitOps conventions or surface as reconcile errors until richer graph ordering exists.valueFromto avoid etcd-unfriendly manifests.Main code layout (anticipated)
api/v1alpha1/*_types.go(per kind files)internal/gatewayclient/(generalisedDeploy/Exists/Delete, path constants)internal/controller/*_controller.go(per kind; optionally sharedgeneric_reconciler.go)RestApireference implementationinternal/controller/restapi_controller.gointernal/registry/gateway_registry.gointernal/auth/auth_helper.goFEATURE_MANAGEMENT_RESOURCES_CRDs.mdGITHUB_DISCUSSION_GATEWAY_API.mdBeta Was this translation helpful? Give feedback.
All reactions