-
-
Notifications
You must be signed in to change notification settings - Fork 613
feat(common): add GatewayClass support with targetSelector linking #45012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
494c31f
Initial plan
Copilot 37ddf1f
feat(common): add GatewayClass support with targetSelector linking
Copilot 52452d1
chore(common): update template and values structure files for gateway…
Copilot 340eb46
refactor(common): extract gatewayClass full name generation to helper
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| workload: | ||
| main: | ||
| enabled: true | ||
| podSpec: | ||
| containers: | ||
| main: | ||
| enabled: true | ||
| args: | ||
| - --port | ||
| - "8080" | ||
| probes: | ||
| liveness: | ||
| enabled: true | ||
| readiness: | ||
| enabled: true | ||
| startup: | ||
| enabled: true | ||
|
|
||
| service: | ||
| main: | ||
| enabled: true | ||
| ports: | ||
| main: | ||
| enabled: true | ||
| port: 8080 | ||
| protocol: http | ||
|
|
||
| gatewayClass: | ||
| main: | ||
| enabled: true | ||
| controllerName: test.io/gateway-controller | ||
| description: Test gateway class | ||
|
|
||
| gateway: | ||
| main: | ||
| enabled: true | ||
| targetSelector: main | ||
| listeners: | ||
| - name: http | ||
| port: 80 | ||
| protocol: HTTP | ||
| allowedRoutes: | ||
| namespaces: | ||
| from: Same | ||
| kinds: | ||
| - group: gateway.networking.k8s.io | ||
| kind: HTTPRoute | ||
|
|
||
| route: | ||
| main: | ||
| enabled: true | ||
| targetSelector: main | ||
| hostnames: | ||
| - chart-example.local | ||
| rules: | ||
| - backendRefs: | ||
| - kind: Service | ||
| name: main | ||
| port: 8080 |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,229 @@ | ||
| --- | ||
| title: GatewayClass | ||
| --- | ||
|
|
||
| :::note | ||
|
|
||
| - This page is generated from JSON schema. | ||
| - See the [Full Examples](/truecharts-common/gatewayclass#full-examples) section for complete examples. | ||
|
|
||
| ::: | ||
|
|
||
| ## Appears in | ||
|
|
||
| - `.Values.gatewayClass` | ||
|
|
||
| --- | ||
|
|
||
| ## `gatewayClass` | ||
|
|
||
| Configuration for `gatewayClass`. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | -------------- | | ||
| | Key | `gatewayClass` | | ||
| | Type | `map` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.annotations` | ||
|
|
||
| Configuration for `gatewayClass.main.annotations`. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | ---------------------------------- | | ||
| | Key | `gatewayClass.$name.annotations` | | ||
| | Type | `map` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.enabled` | ||
|
|
||
| Configuration for `gatewayClass.main.enabled`. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | ------------------------------ | | ||
| | Key | `gatewayClass.$name.enabled` | | ||
| | Type | `boolean, string` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | `false` | | ||
|
|
||
| Example | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| $name: | ||
| enabled: false | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.labels` | ||
|
|
||
| Configuration for `gatewayClass.main.labels`. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | ------------------------------- | | ||
| | Key | `gatewayClass.$name.labels` | | ||
| | Type | `map` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.controllerName` | ||
|
|
||
| Configuration for `gatewayClass.main.controllerName`. The name of the controller that will manage Gateways of this class. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | -------------------------------------- | | ||
| | Key | `gatewayClass.$name.controllerName` | | ||
| | Type | `string` | | ||
| | Required | ✅ (when gatewayClass is enabled) | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| Example | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| $name: | ||
| controllerName: traefik.io/gateway-controller | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.description` | ||
|
|
||
| Configuration for `gatewayClass.main.description`. Description helps describe a GatewayClass with more details. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | ----------------------------------- | | ||
| | Key | `gatewayClass.$name.description` | | ||
| | Type | `string` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| Example | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| $name: | ||
| description: "Traefik-based gateway class" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ### `gatewayClass.$name.parametersRef` | ||
|
|
||
| Configuration for `gatewayClass.main.parametersRef`. ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. | ||
|
|
||
| | Field | Value | | ||
| | ---------- | ------------------------------------ | | ||
| | Key | `gatewayClass.$name.parametersRef` | | ||
| | Type | `map` | | ||
| | Required | ❌ | | ||
| | Helm `tpl` | ❌ | | ||
| | Default | unset | | ||
|
|
||
| Fields for parametersRef: | ||
| - `group`: API group of the referenced resource (required) | ||
| - `kind`: Kind of the referenced resource (required) | ||
| - `name`: Name of the referenced resource (required) | ||
| - `namespace`: Optional namespace of the referenced resource | ||
|
|
||
| --- | ||
|
|
||
| ## Full Examples | ||
|
|
||
| ### Basic GatewayClass | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| main: | ||
| enabled: true | ||
| controllerName: traefik.io/gateway-controller | ||
| ``` | ||
|
|
||
| ### GatewayClass with Description | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| main: | ||
| enabled: true | ||
| controllerName: traefik.io/gateway-controller | ||
| description: "Traefik-based gateway class for HTTP/HTTPS traffic" | ||
| ``` | ||
|
|
||
| ### GatewayClass with ParametersRef | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| main: | ||
| enabled: true | ||
| controllerName: traefik.io/gateway-controller | ||
| parametersRef: | ||
| group: traefik.io | ||
| kind: GatewayClassConfig | ||
| name: traefik-config | ||
| namespace: traefik-system | ||
| ``` | ||
|
|
||
| ### Using GatewayClass with Gateway via targetSelector | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| main: | ||
| enabled: true | ||
| controllerName: traefik.io/gateway-controller | ||
|
|
||
| gateway: | ||
| main: | ||
| enabled: true | ||
| targetSelector: main # Automatically links to gatewayClass.main | ||
| listeners: | ||
| - name: http | ||
| port: 80 | ||
| protocol: HTTP | ||
| ``` | ||
|
|
||
| ### Multiple GatewayClasses | ||
|
|
||
| ```yaml | ||
| gatewayClass: | ||
| traefik: | ||
| enabled: true | ||
| controllerName: traefik.io/gateway-controller | ||
| description: "Traefik gateway class" | ||
|
|
||
| nginx: | ||
| enabled: true | ||
| controllerName: nginx.org/gateway-controller | ||
| description: "NGINX gateway class" | ||
|
|
||
| gateway: | ||
| traefik-gw: | ||
| enabled: true | ||
| targetSelector: traefik # Links to gatewayClass.traefik | ||
| listeners: | ||
| - name: http | ||
| port: 80 | ||
| protocol: HTTP | ||
|
|
||
| nginx-gw: | ||
| enabled: true | ||
| targetSelector: nginx # Links to gatewayClass.nginx | ||
| listeners: | ||
| - name: https | ||
| port: 443 | ||
| protocol: HTTPS | ||
| ``` |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The targetSelector field appears under route configuration at line 3255, but this PR only implements targetSelector for gateway objects, not routes. If route.targetSelector is out of scope for this PR, this appears to be an unrelated addition that should be removed or addressed separately.