Skip to content

Commit 4e2cba2

Browse files
[all] added HTTPRoute to all charts with ingresses via Copilot (#258)
* added HTTPRoute to all charts with ingresses via Copilot * All chart versions have been incremented following semantic versioning (minor version bump) * update test-values.yamls with httproute values * sophora-server: add grpc-httproute * [sophora-webclient] use service.port of values for ingress and HttpRoute * comment parameters like recommended by Helm: "begin with the name of the property" * document comment style in values.yaml * add helm unittest for all relevant charts, fixed problems in templates --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7eb0609 commit 4e2cba2

File tree

111 files changed

+3282
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3282
-233
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. Chart versions have been incremented to new minor versions to reflect these changes.
6+
7+
## Charts Updated
8+
9+
The following 18 charts now support HTTPRoute (Gateway API) in addition to Ingress:
10+
11+
1. **o-neko** - v2.0.1 → v2.1.0
12+
2. **o-neko-catnip** - v1.3.4 → v1.4.0
13+
3. **sophora-admin-dashboard** - v1.5.0 → v1.6.0
14+
4. **sophora-ai** - v2.0.4 → v2.1.0
15+
5. **sophora-contentapi** - v1.0.2 → v1.1.0
16+
6. **sophora-image-access-service** - v1.4.0 → v1.5.0
17+
7. **sophora-image-ai** - v2.1.3 → v2.2.0
18+
8. **sophora-importer** - v2.4.1 → v2.5.0 (HTTPRoute support already existed, updated for consistency)
19+
9. **sophora-indexing-service** - v1.5.0 → v1.6.0
20+
10. **sophora-linkchecker** - v0.1.4 → v0.2.0
21+
11. **sophora-media-finder** - v0.2.6 → v0.3.0
22+
12. **sophora-metadata-supplier** - v1.3.6 → v1.4.0
23+
13. **sophora-schema-docs** - v2.1.4 → v2.2.0
24+
14. **sophora-seo-check** - v1.0.3 → v1.1.0
25+
15. **sophora-server** - v3.1.2 → v3.2.0
26+
16. **sophora-ugc** - v2.0.15 → v2.1.0
27+
17. **sophora-webclient** - v1.4.5 → v1.5.0
28+
18. **sophora-youtube-connector** - v1.2.4 → v1.3.0
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+
matches: [] # array of HTTPRouteMatch objects for matching HTTP requests
53+
filters: [] # array of HTTPRouteFilter objects for modifying requests/responses
54+
annotations: {} # Additional annotations
55+
```
56+
57+
### Special Cases
58+
59+
1. **sophora-image-access-service**: Supports multiple HTTPRoutes via `extraHttpRoutes` 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**: Supports additional HTTPRoute for gRPC service via `grpcHttproute`, similar to its `grpcIngress` support.
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.

charts/o-neko-catnip/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ apiVersion: v2
22
name: o-neko-catnip
33
description: A Helm chart for the O-Neko URL trigger
44
type: application
5-
version: 1.3.4
5+
version: 1.4.0
66
annotations:
77
artifacthub.io/changes: |
88
- kind: added
9-
description: "added Artifacthub changelog annotation"
9+
description: "Added HTTPRoute support for Gateway API"
1010
1111
appVersion: "1.3.2"
1212
sources:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
{{- if .Values.httpRoute.hostnames }}
18+
hostnames:
19+
{{- range .Values.httpRoute.hostnames }}
20+
- {{ required "A hostname for the HTTPRoute must be provided in .Values.httpRoute.hostnames" . | quote }}
21+
{{- end }}
22+
{{- end }}
23+
rules:
24+
- backendRefs:
25+
- name: {{ $fullName }}
26+
port: 8080
27+
{{- with .Values.httpRoute.matches }}
28+
matches:
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
31+
{{- with .Values.httpRoute.filters }}
32+
filters:
33+
{{- toYaml . | nindent 8 }}
34+
{{- end }}
35+
{{- end }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
suite: test httproute
2+
templates:
3+
- httproute.yaml
4+
chart:
5+
version: 0.9.8
6+
appVersion: 1.2.3
7+
tests:
8+
- it: should not create httproute by default
9+
asserts:
10+
- hasDocuments:
11+
count: 0
12+
13+
- it: should create httproute with values
14+
release:
15+
name: values-test-release
16+
values:
17+
- ./values/httproute.yaml
18+
asserts:
19+
- hasDocuments:
20+
count: 1
21+
- containsDocument:
22+
kind: HTTPRoute
23+
apiVersion: gateway.networking.k8s.io/v1
24+
name: values-test-release-o-neko-catnip
25+
- equal:
26+
path: metadata
27+
value:
28+
name: values-test-release-o-neko-catnip
29+
labels:
30+
helm.sh/chart: o-neko-catnip-0.9.8
31+
app.kubernetes.io/name: o-neko-catnip
32+
app.kubernetes.io/version: 1.2.3
33+
app.kubernetes.io/instance: values-test-release
34+
app.kubernetes.io/managed-by: Helm
35+
annotations:
36+
example.com/test: "simple"
37+
example.com/text: some text value
38+
- equal:
39+
path: spec
40+
value:
41+
parentRefs:
42+
- name: my-gateway
43+
namespace: gateway-namespace
44+
hostnames:
45+
- my-service.example.com
46+
- other.example.com
47+
rules:
48+
- backendRefs:
49+
- name: values-test-release-o-neko-catnip
50+
port: 8080
51+
filters:
52+
- type: RequestHeaderModifier
53+
requestHeaderModifier:
54+
set:
55+
- name: X-Custom-Header
56+
value: custom-value
57+
matches:
58+
- path:
59+
type: PathPrefix
60+
value: /
61+
- notFailedTemplate: {}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
httpRoute:
2+
enabled: true
3+
parentRefs:
4+
- name: my-gateway
5+
namespace: gateway-namespace
6+
hostnames:
7+
- my-service.example.com
8+
- other.example.com
9+
matches:
10+
- path:
11+
type: PathPrefix
12+
value: /
13+
filters:
14+
- type: RequestHeaderModifier
15+
requestHeaderModifier:
16+
set:
17+
- name: X-Custom-Header
18+
value: custom-value
19+
annotations:
20+
example.com/test: simple
21+
example.com/text: some text value

0 commit comments

Comments
 (0)