feat: support allowed gateways in tenant namespace rules#1890
Draft
feat: support allowed gateways in tenant namespace rules#1890
Conversation
- Add GatewayNamespacedName, AllowedGatewaySpec, GatewayRuleSpec types to pkg/api/ - Add Gateways field to NamespaceRuleEnforceBody for per-namespace gateway rules - Add HTTPRoute validation webhook to enforce allowed gateways - Add HTTPRoute default mutation webhook to inject default Gateway parentRef - Update Helm chart with validating/mutating webhook configurations for httproutes - Update CRD schemas for tenants and rulestatuses - Add GatewayForbiddenError and ReasonForbiddenGateway event reason Co-authored-by: oliverbaehler <26610571+oliverbaehler@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement feature from issue #1885
feat: support allowed gateways in tenant namespace rules
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capsule previously only restricted
GatewayClassusage at the tenant level. This adds per-namespace enforcement of whichGatewayobjectsHTTPRouteresources may reference, plus optional default Gateway injection.New types (
pkg/api/gateway_rule.go)GatewayNamespacedName— namespaced ref to a GatewayAllowedGatewaySpec— explicit allow list, label selector, and optional default GatewayGatewayRuleSpec— top-level gateway enforcement rule for a namespaceAPI extension
NamespaceRuleEnforceBodygains agateways *GatewayRuleSpecfield; gateway rules use last-wins merge semantics across matching namespace rules (consistent with how a single constraint is applied, vs. registries which aggregate)HTTPRoute validation webhook (
internal/webhook/httproute/)HTTPRoute.spec.parentRefsagainst the resolved namespace rule; denies routes referencing Gateways not in the allow list or label selectorTypedTenantWithRulesetHandlerpattern used by pod/registry validationHTTPRoute default mutation (
internal/webhook/defaults/httproute.go)parentRefwhen anHTTPRoutehas noparentRefsHelm chart
httproutesvalidating and mutating webhook configs (mirroring thegatewaysstructure)reinvocationPolicyto existinggatewaysmutating webhook valuestenantsandrulestatusesExample
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.