feat(common): add Gateway API Gateway resource with automatic route linking#45010
feat(common): add Gateway API Gateway resource with automatic route linking#45010Crow-Control merged 2 commits intocommon2026from
Conversation
Co-authored-by: PrivatePuffin <7613738+PrivatePuffin@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for Kubernetes Gateway API Gateway resources with automatic route linking capabilities, enabling users to create Gateway objects from values.yaml and dynamically link routes to gateways using a targetSelector field.
Changes:
- Added Gateway API Gateway resource template and spawner for creating Gateway objects
- Implemented
targetSelectorfield in routes for automatic gateway linking via parentRef generation - Fixed route primary helper to handle missing values gracefully
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| charts/library/common/values.yaml | Added gateway configuration section with listeners, TLS, and allowedRoutes; documented targetSelector field for routes |
| charts/library/common/templates/spawner/_gateway.tpl | Created gateway spawner template for rendering Gateway objects |
| charts/library/common/templates/loader/_apply.tpl | Integrated gateway spawner into template rendering pipeline |
| charts/library/common/templates/lib/util/_primary_route.tpl | Fixed to handle missing route values with default dict |
| charts/library/common/templates/lib/util/_primary_gateway.tpl | Created helper to identify primary gateway for selection logic |
| charts/library/common/templates/class/_route.tpl | Added targetSelector logic to auto-generate parentRefs from gateway name |
| charts/library/common/templates/class/_gateway.tpl | Created Gateway resource template with full Gateway API v1 spec support |
| charts/library/common/schemas/route.json | Added targetSelector field schema definition |
| charts/library/common/schemas/gateway.json | Created comprehensive JSON schema for gateway configuration |
| charts/library/common/docs/route.md | Added targetSelector documentation and examples with automatic gateway linking |
| charts/library/common/docs/gateway.md | Created complete gateway documentation with multiple usage examples |
| charts/library/common/Chart.yaml | Bumped chart version to 29.1.0 |
| charts/library/common-test/tests/gateway/integration_test.yaml | Added integration tests for gateway-route linking scenarios |
| charts/library/common-test/tests/gateway/basic_test.yaml | Added basic gateway creation and enablement tests |
| charts/library/common-test/ci/gateway-values.yaml | Added CI configuration for gateway feature testing |
| kind: HTTPRoute | ||
| parentRefs: | ||
| - group: gateway.networking.k8s.io | ||
| kind: Gateway | ||
| name: main | ||
| namespace: default | ||
| hostnames: | ||
| - app.example.com | ||
| rules: | ||
| - backendRefs: | ||
| - kind: Service | ||
| name: main | ||
| port: 80 | ||
| matches: | ||
| - path: | ||
| type: PathPrefix | ||
| value: / | ||
| ``` |
There was a problem hiding this comment.
The example from line 234 to 251 appears to be duplicate or misplaced content, as it shows manual parentRefs configuration after the targetSelector example. This duplicated block should be removed or clarified if it serves a different purpose.
| kind: HTTPRoute | |
| parentRefs: | |
| - group: gateway.networking.k8s.io | |
| kind: Gateway | |
| name: main | |
| namespace: default | |
| hostnames: | |
| - app.example.com | |
| rules: | |
| - backendRefs: | |
| - kind: Service | |
| name: main | |
| port: 80 | |
| matches: | |
| - path: | |
| type: PathPrefix | |
| value: / | |
| ``` |
|
This PR is locked to prevent necro-posting on closed PRs. Please create a issue or contact staff on discord if you want to further discuss this |
Adds support for creating Kubernetes Gateway API Gateway objects from values.yaml, with optional name-based dynamic linking between routes and gateways via
targetSelector.Gateway Resource Support
Dynamic Route Linking
targetSelectorto automatically generateparentRefspointing to a named gatewayparentRefsstill supported whentargetSelectoris omittedExample Usage
Implementation
templates/class/_gateway.tpl)templates/spawner/_gateway.tpl)targetSelectorparentRef generationVersion bumped to 29.1.0.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.