Skip to content

Commit 675c18a

Browse files
committed
feat: Allow to use HTTPRoute from Gateway API.
Signed-off-by: Miroslav Hlavka <miroslav.hlavka@goto.com>
1 parent c82afcc commit 675c18a

4 files changed

Lines changed: 83 additions & 2 deletions

File tree

charts/dex/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
type: application
33
name: dex
4-
version: 0.24.0
4+
version: 0.24.1
55
appVersion: "2.44.0"
66
kubeVersion: ">=1.14.0-0"
77
description: OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.

charts/dex/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# dex
22

3-
![version: 0.24.0](https://img.shields.io/badge/version-0.24.0-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.44.0](https://img.shields.io/badge/app%20version-2.44.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex)
3+
![version: 0.24.1](https://img.shields.io/badge/version-0.24.1-informational?style=flat-square) ![type: application](https://img.shields.io/badge/type-application-informational?style=flat-square) ![app version: 2.44.0](https://img.shields.io/badge/app%20version-2.44.0-informational?style=flat-square) ![kube version: >=1.14.0-0](https://img.shields.io/badge/kube%20version->=1.14.0--0-informational?style=flat-square) [![artifact hub](https://img.shields.io/badge/artifact%20hub-dex-informational?style=flat-square)](https://artifacthub.io/packages/helm/dex/dex)
44

55
OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors.
66

@@ -162,6 +162,11 @@ ingress:
162162
| ingress.annotations | object | `{}` | Annotations to be added to the ingress. |
163163
| ingress.hosts | list | See [values.yaml](values.yaml). | Ingress host configuration. |
164164
| ingress.tls | list | See [values.yaml](values.yaml). | Ingress TLS configuration. |
165+
| httproute.enabled | bool | `false` | Enable Gateway API HTTPRoute. Gateway API support is in EXPERIMENTAL status. Support depends on your Gateway controller implementation. See the [Gateway API documentation](https://gateway-api.sigs.k8s.io/) for details. |
166+
| httproute.annotations | object | `{}` | Annotations to be added to the HTTPRoute. |
167+
| httproute.parentRefs | list | `[]` | References to the Gateway(s) that this HTTPRoute is attached to. See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference) for details. |
168+
| httproute.hostnames | list | `["chart-example.local"]` | Hostnames defines the hostnames for routing. See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname) for details. |
169+
| httproute.rules | list | `[{"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]` | HTTPRoute rules configuration. See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPRouteRule) for details. |
165170
| serviceMonitor.enabled | bool | `false` | Enable Prometheus ServiceMonitor. See the [documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/design.md#servicemonitor) and the [API reference](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor) for details. |
166171
| serviceMonitor.namespace | string | Release namespace. | Namespace where the ServiceMonitor resource should be deployed. |
167172
| serviceMonitor.interval | duration | `nil` | Prometheus scrape interval. |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "dex.fullname" . -}}
3+
{{- $svcPort := .Values.service.ports.http.port -}}
4+
apiVersion: gateway.networking.k8s.io/v1
5+
kind: HTTPRoute
6+
metadata:
7+
name: {{ $fullName }}
8+
namespace: {{ include "dex.namespace" . }}
9+
labels:
10+
{{- include "dex.labels" . | nindent 4 }}
11+
{{- with .Values.httproute.annotations }}
12+
annotations:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
15+
spec:
16+
parentRefs:
17+
{{- with .Values.httproute.parentRefs }}
18+
{{- toYaml . | nindent 4 }}
19+
{{- end }}
20+
{{- with .Values.httproute.hostnames }}
21+
hostnames:
22+
{{- toYaml . | nindent 4 }}
23+
{{- end }}
24+
rules:
25+
{{- range .Values.httproute.rules }}
26+
{{- with .matches }}
27+
- matches:
28+
{{- toYaml . | nindent 8 }}
29+
{{- end }}
30+
{{- with .filters }}
31+
filters:
32+
{{- toYaml . | nindent 8 }}
33+
{{- end }}
34+
backendRefs:
35+
- group: ''
36+
kind: Service
37+
name: {{ $fullName }}
38+
port: {{ $svcPort }}
39+
weight: 1
40+
{{- end }}
41+
{{- end }}

charts/dex/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,41 @@ ingress:
220220
# hosts:
221221
# - chart-example.local
222222

223+
httpRoute:
224+
# -- Enable Gateway API HTTPRoute.
225+
# Gateway API support is in EXPERIMENTAL status. Support depends on your Gateway controller implementation.
226+
# See the [Gateway API documentation](https://gateway-api.sigs.k8s.io/) for details.
227+
enabled: false
228+
229+
# -- Annotations to be added to the HTTPRoute.
230+
annotations: {}
231+
232+
# -- References to the Gateway(s) that this HTTPRoute is attached to.
233+
# See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ParentReference) for details.
234+
parentRefs: []
235+
# - name: gateway
236+
# namespace: gateway-system
237+
# sectionName: https
238+
# port: 443
239+
240+
# -- Hostnames defines the hostnames for routing.
241+
# See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname) for details.
242+
hostnames:
243+
- chart-example.local
244+
245+
# -- HTTPRoute rules configuration.
246+
# See the [API reference](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPRouteRule) for details.
247+
rules:
248+
- matches:
249+
- path:
250+
type: PathPrefix
251+
value: /
252+
# filters:
253+
# - type: RequestHeaderModifier
254+
# requestHeaderModifier:
255+
# add:
256+
# - name: X-Custom-Header
257+
# value: custom-value
223258
serviceMonitor:
224259
# -- Enable Prometheus ServiceMonitor.
225260
# See the [documentation](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/design.md#servicemonitor) and the [API reference](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitor) for details.

0 commit comments

Comments
 (0)