Skip to content

Commit 79ee291

Browse files
committed
added HTTPRoute to all charts with ingresses via Copilot
1 parent d1c9df3 commit 79ee291

File tree

35 files changed

+828
-0
lines changed

35 files changed

+828
-0
lines changed

HTTPROUTE_CHANGES.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# HTTPRoute Support Added to Helm Charts
2+
3+
## Summary
4+
5+
All Helm charts in the `helm-charts` repository that contain Kubernetes Ingress resources have been extended to also provide optional HTTPRoute resources for the Gateway API.
6+
7+
## Charts Updated
8+
9+
The following 18 charts now support HTTPRoute (Gateway API) in addition to Ingress:
10+
11+
1. **o-neko** - Added httproute.yaml template and values
12+
2. **o-neko-catnip** - Added httproute.yaml template and values
13+
3. **sophora-admin-dashboard** - Added httproute.yaml template and values
14+
4. **sophora-ai** - Added httproute.yaml template and values
15+
5. **sophora-contentapi** - Added httproute.yaml template and values
16+
6. **sophora-image-access-service** - Added httproute.yaml template and values (with support for multiple routes)
17+
7. **sophora-image-ai** - Added httproute.yaml template and values
18+
8. **sophora-importer** - HTTPRoute support already existed (no changes needed)
19+
9. **sophora-indexing-service** - Added httproute.yaml template and values
20+
10. **sophora-linkchecker** - Added httproute.yaml template and values
21+
11. **sophora-media-finder** - Added httproute.yaml template and values
22+
12. **sophora-metadata-supplier** - Added httproute.yaml template and values
23+
13. **sophora-schema-docs** - Added httproute.yaml template and values
24+
14. **sophora-seo-check** - Added httproute.yaml template and values
25+
15. **sophora-server** - Added httproute.yaml template and values
26+
16. **sophora-ugc** - Added httproute.yaml template and values
27+
17. **sophora-webclient** - Added httproute.yaml template and values
28+
18. **sophora-youtube-connector** - Added httproute.yaml template and values
29+
30+
## Implementation Details
31+
32+
### HTTPRoute Templates
33+
34+
Each chart now includes a `templates/httproute.yaml` file that:
35+
- Is conditionally created based on `httproute.enabled` value
36+
- Uses the Gateway API v1 specification
37+
- Supports parentRefs for Gateway attachment
38+
- Supports hostname filtering
39+
- Supports path matching (PathPrefix, Exact, or RegularExpression)
40+
- Includes the same labels and annotations pattern as Ingress resources
41+
- Routes traffic to the same backend service as the Ingress
42+
43+
### Values.yaml Configuration
44+
45+
Each chart's `values.yaml` file now includes an `httproute` section with the following configuration options:
46+
47+
```yaml
48+
httproute:
49+
enabled: false # Whether to create HTTPRoute (disabled by default)
50+
parentRefs: [] # Gateway references
51+
hostnames: [] # Hostnames for routing
52+
pathMatchType: PathPrefix # Path match type (PathPrefix, Exact, RegularExpression)
53+
pathValue: / # Path value for matching
54+
annotations: {} # Additional annotations
55+
```
56+
57+
### Special Cases
58+
59+
1. **sophora-image-access-service**: Supports multiple HTTPRoutes via `extraHTTPRoute` array, similar to its `extraIngress` support.
60+
61+
2. **sophora-importer**: Already had HTTPRoute support with a more advanced configuration including custom rules and filters.
62+
63+
3. **sophora-server**: Uses the server's HTTP port from `sophora.server.ports.http` configuration.
64+
65+
## Usage Example
66+
67+
To enable HTTPRoute for a chart deployment:
68+
69+
```yaml
70+
httproute:
71+
enabled: true
72+
parentRefs:
73+
- name: my-gateway
74+
namespace: gateway-system
75+
hostnames:
76+
- "myapp.example.com"
77+
pathMatchType: PathPrefix
78+
pathValue: /
79+
annotations:
80+
custom.annotation: "value"
81+
```
82+
83+
## Migration Path
84+
85+
Users can:
86+
1. Continue using Ingress resources (default behavior)
87+
2. Enable HTTPRoute alongside Ingress for testing
88+
3. Migrate to HTTPRoute exclusively by disabling Ingress and enabling HTTPRoute
89+
90+
All changes are backward compatible - existing deployments will continue to work without modification.
91+
92+
## Gateway API Compatibility
93+
94+
The HTTPRoute resources use the `gateway.networking.k8s.io/v1` API version, which is the stable Gateway API specification.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "o-neko-catnip.fullname" . -}}
3+
apiVersion: gateway.networking.k8s.io/v1
4+
kind: HTTPRoute
5+
metadata:
6+
labels: {{- include "o-neko-catnip.labels" . | nindent 4 }}
7+
name: {{ $fullName }}
8+
{{- with .Values.httproute.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
{{- with .Values.httproute.parentRefs }}
14+
parentRefs:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- range .Values.httproute.hostnames }}
18+
hostnames:
19+
- {{ required "A hostname for the HTTPRoute must be provided in .Values.httproute.hostnames" . | quote }}
20+
{{- end }}
21+
rules:
22+
- backendRefs:
23+
- name: {{ $fullName }}
24+
port: 8080
25+
matches:
26+
- path:
27+
type: {{ .Values.httproute.pathMatchType | default "PathPrefix" }}
28+
value: {{ .Values.httproute.pathValue | default "/" }}
29+
{{- end }}

charts/o-neko-catnip/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ ingress:
119119
defaultBackend:
120120
enabled: false
121121

122+
httproute:
123+
## @param httproute.enabled Whether to create an HTTPRoute resource (Gateway API)
124+
enabled: false
125+
## @param httproute.parentRefs References to the Gateway resources that the HTTPRoute should attach to
126+
## e.g.
127+
## parentRefs:
128+
## - name: my-gateway
129+
## namespace: gateway-namespace
130+
parentRefs: []
131+
## @param httproute.hostnames Array with hostnames used for the HTTPRoute
132+
## e.g.
133+
## hostnames:
134+
## - "catnip.oneko.com"
135+
hostnames: []
136+
## @param httproute.pathMatchType Path match type for the HTTPRoute (PathPrefix, Exact, or RegularExpression)
137+
pathMatchType: PathPrefix
138+
## @param httproute.pathValue Path value for the HTTPRoute
139+
pathValue: /
140+
## @param httproute.annotations annotations for the HTTPRoute
141+
annotations: {}
142+
122143
## @section Metrics and Alerting
123144
##
124145
## Specific for the use with the kube-prometheus-stack
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "o-neko.fullname" . -}}
3+
apiVersion: gateway.networking.k8s.io/v1
4+
kind: HTTPRoute
5+
metadata:
6+
labels: {{- include "o-neko.labels" . | nindent 4 }}
7+
name: {{ $fullName }}
8+
{{- with .Values.httproute.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
{{- with .Values.httproute.parentRefs }}
14+
parentRefs:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- range .Values.httproute.hostnames }}
18+
hostnames:
19+
- {{ required "A hostname for the HTTPRoute must be provided in .Values.httproute.hostnames" . | quote }}
20+
{{- end }}
21+
rules:
22+
- backendRefs:
23+
- name: {{ $fullName }}
24+
port: 8080
25+
matches:
26+
- path:
27+
type: {{ .Values.httproute.pathMatchType | default "PathPrefix" }}
28+
value: {{ .Values.httproute.pathValue | default "/" }}
29+
{{- end }}

charts/o-neko/values.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,27 @@ ingress:
148148
## @param ingress.annotations annotations for the ingress
149149
annotations: {}
150150

151+
httproute:
152+
## @param httproute.enabled Whether to create an HTTPRoute resource (Gateway API)
153+
enabled: false
154+
## @param httproute.parentRefs References to the Gateway resources that the HTTPRoute should attach to
155+
## e.g.
156+
## parentRefs:
157+
## - name: my-gateway
158+
## namespace: gateway-namespace
159+
parentRefs: []
160+
## @param httproute.hostnames Array with hostnames used for the HTTPRoute
161+
## e.g.
162+
## hostnames:
163+
## - "oneko.my-company.com"
164+
hostnames: []
165+
## @param httproute.pathMatchType Path match type for the HTTPRoute (PathPrefix, Exact, or RegularExpression)
166+
pathMatchType: PathPrefix
167+
## @param httproute.pathValue Path value for the HTTPRoute
168+
pathValue: /
169+
## @param httproute.annotations annotations for the HTTPRoute
170+
annotations: {}
171+
151172
## @section Metrics
152173
##
153174
## Specific for the use with the kube-prometheus-stack
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "sophora-admin-dashboard.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
apiVersion: gateway.networking.k8s.io/v1
5+
kind: HTTPRoute
6+
metadata:
7+
name: {{ $fullName }}
8+
labels:
9+
{{- include "sophora-admin-dashboard.labels" . | nindent 4 }}
10+
{{- with .Values.httproute.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- with .Values.httproute.parentRefs }}
16+
parentRefs:
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
19+
{{- if .Values.httproute.hostnames }}
20+
hostnames:
21+
{{- range .Values.httproute.hostnames }}
22+
- {{ . | quote }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
- backendRefs:
27+
- name: {{ $fullName }}
28+
port: {{ $svcPort }}
29+
matches:
30+
- path:
31+
type: {{ .Values.httproute.pathMatchType | default "PathPrefix" }}
32+
value: {{ .Values.httproute.pathValue | default "/" }}
33+
{{- end }}

charts/sophora-admin-dashboard/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ ingress:
208208
# hosts:
209209
# - chart-example.local
210210

211+
httproute:
212+
enabled: false
213+
# parentRefs:
214+
# - name: my-gateway
215+
# namespace: gateway-namespace
216+
parentRefs: []
217+
# hostnames:
218+
# - "dashboard.example.com"
219+
hostnames: []
220+
pathMatchType: PathPrefix
221+
pathValue: /
222+
annotations: {}
223+
211224
resources:
212225
requests:
213226
cpu: 50m
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "sophora-ai.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
apiVersion: gateway.networking.k8s.io/v1
5+
kind: HTTPRoute
6+
metadata:
7+
name: {{ $fullName }}
8+
labels:
9+
{{- include "sophora-ai.labels" . | nindent 4 }}
10+
{{- with .Values.httproute.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- with .Values.httproute.parentRefs }}
16+
parentRefs:
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
19+
{{- if .Values.httproute.hostnames }}
20+
hostnames:
21+
{{- range .Values.httproute.hostnames }}
22+
- {{ . | quote }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
- backendRefs:
27+
- name: {{ $fullName }}
28+
port: {{ $svcPort }}
29+
matches:
30+
- path:
31+
type: {{ .Values.httproute.pathMatchType | default "PathPrefix" }}
32+
value: {{ .Values.httproute.pathValue | default "/" }}
33+
{{- end }}

charts/sophora-ai/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ ingress:
216216
hosts:
217217
tls: []
218218

219+
httproute:
220+
enabled: false
221+
parentRefs: []
222+
hostnames: []
223+
pathMatchType: PathPrefix
224+
pathValue: /
225+
annotations: {}
226+
219227
extraDeploy: []
220228

221229
# Extra volumes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.httproute.enabled -}}
2+
{{- $fullName := include "sophora-contentapi.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
apiVersion: gateway.networking.k8s.io/v1
5+
kind: HTTPRoute
6+
metadata:
7+
name: {{ $fullName }}
8+
labels:
9+
{{- include "sophora-contentapi.labels" . | nindent 4 }}
10+
{{- with .Values.httproute.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- with .Values.httproute.parentRefs }}
16+
parentRefs:
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
19+
{{- if .Values.httproute.hostnames }}
20+
hostnames:
21+
{{- range .Values.httproute.hostnames }}
22+
- {{ . | quote }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
- backendRefs:
27+
- name: {{ $fullName }}
28+
port: {{ $svcPort }}
29+
matches:
30+
- path:
31+
type: {{ .Values.httproute.pathMatchType | default "PathPrefix" }}
32+
value: {{ .Values.httproute.pathValue | default "/" }}
33+
{{- end }}

0 commit comments

Comments
 (0)