Skip to content

Commit 0c00c57

Browse files
jmoosdijktuunit
andauthored
feat(gateway-api): support full ParentRef fields in HTTPRoute (#394)
* feat: ability to configure gateway-api listener to bind to Signed-off-by: Jarno van de Moosdijk <jarnovandemoosdijk@gmail.com> * feat: full support for ParentRef fields of gateway-api HTTPRoutes Signed-off-by: Jan Larwig <jan@larwig.com> --------- Signed-off-by: Jarno van de Moosdijk <jarnovandemoosdijk@gmail.com> Signed-off-by: Jan Larwig <jan@larwig.com> Co-authored-by: Jan Larwig <jan@larwig.com>
1 parent 93b9b85 commit 0c00c57

4 files changed

Lines changed: 15 additions & 16 deletions

File tree

helm/oauth2-proxy/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 10.1.5
2+
version: 10.2.0
33
apiVersion: v2
44
appVersion: 7.15.0
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -30,8 +30,8 @@ maintainers:
3030
kubeVersion: ">=1.16.0-0"
3131
annotations:
3232
artifacthub.io/changes: |
33-
- kind: changed
34-
description: Bump OAuth2 Proxy image to v7.15.0
33+
- kind: added
34+
description: feat: full support for ParentRef fields of gateway-api HTTPRoutes
3535
links:
3636
- name: GitHub PR
37-
url: https://github.com/oauth2-proxy/manifests/pull/395
37+
url: https://github.com/oauth2-proxy/manifests/pull/391

helm/oauth2-proxy/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ With above new chart version won't add extra `-ha` suffix to all redis resources
148148
The following table lists the configurable parameters of the oauth2-proxy chart and their default values.
149149

150150
| Parameter | Description | Default |
151-
|-------------------------------------------------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
151+
|-------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
152152
| `affinity` | node/pod affinities | None |
153153
| `alphaConfig.annotations` | Configmap annotations | `{}` |
154154
| `alphaConfig.configData` | Arbitrary configuration data to append | `{}` |
@@ -198,8 +198,7 @@ The following table lists the configurable parameters of the oauth2-proxy chart
198198
| `extraVolumes` | list of extra volumes | `[]` |
199199
| `gatewayApi.annotations` | Additional annotations to add to the HTTPRoute | `{}` |
200200
| `gatewayApi.enabled` | Enable Gateway API HTTPRoute | `false` |
201-
| `gatewayApi.gatewayRef.name` | Name of the Gateway resource to attach the HTTPRoute to | `""` |
202-
| `gatewayApi.gatewayRef.namespace` | Namespace of the Gateway resource | `""` |
201+
| `gatewayApi.gatewayRef` | The ParentRef of the HTTPRoute according to: https://gateway-api.sigs.k8s.io/reference/spec/#parentreference | `{}` |
203202
| `gatewayApi.hostnames` | Hostnames to match in the HTTPRoute | `[]` |
204203
| `gatewayApi.labels` | Additional labels to add to the HTTPRoute | `{}` |
205204
| `gatewayApi.rules` | HTTPRoute rule configuration. If not specified, a default rule with PathPrefix `/` will be created | `[]` |
@@ -353,6 +352,7 @@ gatewayApi:
353352
gatewayRef:
354353
name: my-gateway
355354
namespace: gateway-system
355+
sectionName: my-gateway-https-listener-name
356356
hostnames:
357357
- oauth.example.com
358358
rules:
@@ -372,7 +372,8 @@ gatewayApi:
372372
example.com/annotation: "value"
373373
```
374374
375-
If you don't specify custom rules, the chart will create a default rule that matches all paths with `PathPrefix: /` and routes to the oauth2-proxy service.
375+
If you don't specify custom rules, the chart will create a default rule that matches all paths with `PathPrefix: /` and routes to the oauth2-proxy service.
376+
If you don't specify a sectionName, the rules will be applied to all listeners of the referenced Gateway.
376377

377378
## TLS Configuration
378379

helm/oauth2-proxy/templates/httproute.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ metadata:
1717
{{ tpl ( toYaml . ) $ | indent 4 }}
1818
{{- end }}
1919
spec:
20-
{{- if .Values.gatewayApi.gatewayRef.name }}
20+
{{- with .Values.gatewayApi.gatewayRef }}
2121
parentRefs:
22-
- name: {{ .Values.gatewayApi.gatewayRef.name }}
23-
{{- if .Values.gatewayApi.gatewayRef.namespace }}
24-
namespace: {{ .Values.gatewayApi.gatewayRef.namespace }}
25-
{{- end }}
22+
- {{ toYaml . | nindent 4 | trim }}
2623
{{- end }}
2724
{{- if .Values.gatewayApi.hostnames }}
2825
hostnames:

helm/oauth2-proxy/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@ gatewayApi:
235235
# gatewayRef:
236236
# name: gateway
237237
# namespace: gateway-system
238-
gatewayRef:
239-
name: ""
240-
namespace: ""
238+
# sectionName: my-gateway-https-listener-name
239+
#
240+
# https://gateway-api.sigs.k8s.io/reference/spec/#parentreference
241+
gatewayRef: {}
241242
# HTTPRoute rule configuration
242243
# rules:
243244
# - matches:

0 commit comments

Comments
 (0)