Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions charts/library/common-test/ci/gatewayclass-values.yaml
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
2 changes: 1 addition & 1 deletion charts/library/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ sources:
- https://github.com/trueforge-org/truecharts/tree/master/charts/library/common
- https://hub.docker.com/_/
type: library
version: 29.1.0
version: 29.2.0
31 changes: 31 additions & 0 deletions charts/library/common/complete-values-structure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,11 @@ configMapsFromFolder:
test-label: ''
annotations:
test-annotation: ''
fileAttributeOverrides:
template.tpl:
escaped: true
.gitkeep:
exclude: true
test-scripts:
labels:
test-label: ''
Expand Down Expand Up @@ -3196,6 +3201,31 @@ ingress:
customkv: null
version: 2
certificate: {}
gatewayClass:
main:
enabled: false
annotations: {}
labels: {}
controllerName: ''
description: ''
gateway:
main:
enabled: false
annotations: {}
labels: {}
gatewayClassName: ''
listeners:
- name: ''
hostname: null
port: 80
protocol: ''
allowedRoutes:
namespaces:
from: ''
kinds:
- group: ''
kind: ''
targetSelector: ''
route:
objectname:
enabled: false
Expand All @@ -3222,6 +3252,7 @@ route:
- path:
type: ''
value: ''
targetSelector: ''
Copy link

Copilot AI Feb 15, 2026

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.

Suggested change
targetSelector: ''

Copilot uses AI. Check for mistakes.
podDisruptionBudget:
main:
enabled: false
Expand Down
22 changes: 22 additions & 0 deletions charts/library/common/docs/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@ gateway:

---

### `gateway.$name.targetSelector`

Configuration for `gateway.main.targetSelector`. Name-based selector for automatic GatewayClass linking. When set, automatically references the specified `gatewayClass.$name`.

| Field | Value |
| ---------- | ------------------------------- |
| Key | `gateway.$name.targetSelector` |
| Type | `string` |
| Required | ❌ |
| Helm `tpl` | ❌ |
| Default | unset |

Example

```yaml
gateway:
$name:
targetSelector: main # Links to gatewayClass.main
```

---

### `gateway.$name.labels`

Configuration for `gateway.main.labels`.
Expand Down
229 changes: 229 additions & 0 deletions charts/library/common/docs/gatewayclass.md
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
```
4 changes: 4 additions & 0 deletions charts/library/common/schemas/gateway.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"description": "Configuration for `gateway.main.gatewayClassName`.",
"minLength": 1
},
"targetSelector": {
"type": "string",
"description": "Configuration for `gateway.main.targetSelector`. Name-based selector for automatic GatewayClass linking."
},
"listeners": {
"type": "array",
"items": {
Expand Down
Loading
Loading