From 6b7cd82aee8db8fd2fb4d6e1093e2b68eada1696 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 10:36:44 +0200 Subject: [PATCH 01/14] [all] change Gateway support to configure a list of httpRoutes --- .../templates/httproute.yaml | 21 +++---- .../tests/httproute_test.yaml | 21 ++++++- .../tests/values/httproute.yaml | 10 +++- charts/sophora-admin-dashboard/values.yaml | 55 ++++++++--------- .../templates/httproute.yaml | 8 +-- .../tests/httproute_test.yaml | 21 ++++++- .../tests/values/httproute.yaml | 10 +++- .../sophora-image-access-service/values.yaml | 59 +++++++------------ 8 files changed, 108 insertions(+), 97 deletions(-) diff --git a/charts/sophora-admin-dashboard/templates/httproute.yaml b/charts/sophora-admin-dashboard/templates/httproute.yaml index 9f6b1aa5..132094ae 100644 --- a/charts/sophora-admin-dashboard/templates/httproute.yaml +++ b/charts/sophora-admin-dashboard/templates/httproute.yaml @@ -1,24 +1,24 @@ -{{- if .Values.httpRoute.enabled -}} {{- $fullName := include "sophora-admin-dashboard.fullname" . -}} {{- $svcPort := .Values.service.port -}} +{{- range $index, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}{{ eq $index 0 | ternary "" (printf "-%d" $index) }} labels: - {{- include "sophora-admin-dashboard.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- include "sophora-admin-dashboard.labels" $ | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +26,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-admin-dashboard/tests/httproute_test.yaml b/charts/sophora-admin-dashboard/tests/httproute_test.yaml index 1737dfaa..e6773a33 100644 --- a/charts/sophora-admin-dashboard/tests/httproute_test.yaml +++ b/charts/sophora-admin-dashboard/tests/httproute_test.yaml @@ -9,19 +9,24 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 + count: 2 - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 name: values-test-release-sophora-admin-dashboard + - containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-admin-dashboard-1 - equal: + documentIndex: 0 path: metadata value: name: values-test-release-sophora-admin-dashboard @@ -34,6 +39,7 @@ tests: example.com/test: "simple" example.com/text: some text value - equal: + documentIndex: 0 path: spec value: parentRefs: @@ -56,4 +62,13 @@ tests: - path: type: PathPrefix value: / - - notFailedTemplate: {} + - equal: + documentIndex: 1 + path: metadata.name + value: values-test-release-sophora-admin-dashboard-1 + - equal: + documentIndex: 1 + path: spec.hostnames + value: + - second.example.com + - notFailedTemplate: {} \ No newline at end of file diff --git a/charts/sophora-admin-dashboard/tests/values/httproute.yaml b/charts/sophora-admin-dashboard/tests/values/httproute.yaml index fa51e6cc..09e4411d 100644 --- a/charts/sophora-admin-dashboard/tests/values/httproute.yaml +++ b/charts/sophora-admin-dashboard/tests/values/httproute.yaml @@ -1,6 +1,5 @@ -httpRoute: - enabled: true - parentRefs: +httpRoutes: +- parentRefs: - name: my-gateway namespace: gateway-namespace hostnames: @@ -19,3 +18,8 @@ httpRoute: annotations: example.com/test: simple example.com/text: some text value +- parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-admin-dashboard/values.yaml b/charts/sophora-admin-dashboard/values.yaml index 9e84dd81..6aa5b01b 100644 --- a/charts/sophora-admin-dashboard/values.yaml +++ b/charts/sophora-admin-dashboard/values.yaml @@ -208,38 +208,29 @@ ingress: # hosts: # - chart-example.local -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes List of HTTPRoute resources (Gateway API) to create +httpRoutes: [] + # httpRoutes[0].parentRefs References to the Gateway resources that the HTTPRoute should attach to + #- parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # httpRoutes[0].hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # httpRoutes[0].matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: /sophora.srpc + # httpRoutes[0].filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # httpRoutes[0].annotations annotations for the HTTPRoute + # annotations: {} resources: requests: diff --git a/charts/sophora-image-access-service/templates/httproute.yaml b/charts/sophora-image-access-service/templates/httproute.yaml index 969beea5..74693614 100644 --- a/charts/sophora-image-access-service/templates/httproute.yaml +++ b/charts/sophora-image-access-service/templates/httproute.yaml @@ -1,10 +1,6 @@ -{{ $allHTTPRoutes := .Values.extraHttpRoutes -}} -{{ if .Values.httpRoute.enabled -}} - {{ $allHTTPRoutes = prepend $allHTTPRoutes .Values.httpRoute -}} -{{ end -}} {{ $fullName := include "access-service.fullname" $ -}} {{ $svcPort := $.Values.service.httpPort -}} -{{ range $index, $httpRoute := $allHTTPRoutes -}} +{{ range $index, $httpRoute := .Values.httpRoutes -}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: @@ -39,4 +35,4 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} --- -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/sophora-image-access-service/tests/httproute_test.yaml b/charts/sophora-image-access-service/tests/httproute_test.yaml index a4fcd67d..2e136100 100644 --- a/charts/sophora-image-access-service/tests/httproute_test.yaml +++ b/charts/sophora-image-access-service/tests/httproute_test.yaml @@ -10,19 +10,24 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 + count: 2 - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 name: sophora-image-access-service + - containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: sophora-image-access-service-1 - equal: + documentIndex: 0 path: metadata value: name: sophora-image-access-service @@ -36,6 +41,7 @@ tests: example.com/test: "simple" example.com/text: some text value - equal: + documentIndex: 0 path: spec value: parentRefs: @@ -58,4 +64,13 @@ tests: - path: type: PathPrefix value: / - - notFailedTemplate: {} + - equal: + documentIndex: 1 + path: metadata.name + value: sophora-image-access-service-1 + - equal: + documentIndex: 1 + path: spec.hostnames + value: + - second.example.com + - notFailedTemplate: {} \ No newline at end of file diff --git a/charts/sophora-image-access-service/tests/values/httproute.yaml b/charts/sophora-image-access-service/tests/values/httproute.yaml index fa51e6cc..09e4411d 100644 --- a/charts/sophora-image-access-service/tests/values/httproute.yaml +++ b/charts/sophora-image-access-service/tests/values/httproute.yaml @@ -1,6 +1,5 @@ -httpRoute: - enabled: true - parentRefs: +httpRoutes: +- parentRefs: - name: my-gateway namespace: gateway-namespace hostnames: @@ -19,3 +18,8 @@ httpRoute: annotations: example.com/test: simple example.com/text: some text value +- parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-image-access-service/values.yaml b/charts/sophora-image-access-service/values.yaml index 9005b007..bc2f4bbb 100644 --- a/charts/sophora-image-access-service/values.yaml +++ b/charts/sophora-image-access-service/values.yaml @@ -81,46 +81,31 @@ extraIngress: [] # hosts: # tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} - -extraHttpRoutes: [] +# httpRoutes List of HTTPRoute resources (Gateway API) to create +httpRoutes: [] + # httpRoutes[0].parentRefs References to the Gateway resources that the HTTPRoute should attach to #- parentRefs: # - name: my-gateway + # namespace: gateway-namespace + # httpRoutes[0].hostnames Array with hostnames used for the HTTPRoute + # e.g. # hostnames: - # - example.com - # matches: [] - # filters: [] + # - "my-service.example.com" + # httpRoutes[0].matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # e.g. + # matches: + # - path: + # type: PathPrefix + # value: / + # httpRoutes[0].filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # e.g. + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # httpRoutes[0].annotations annotations for the HTTPRoute # annotations: {} serviceAccount: From 69332ea3afeafb0da0fb4ad0906043a1dab2ed87 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 10:40:48 +0200 Subject: [PATCH 02/14] update chart version and changelog --- charts/sophora-admin-dashboard/Chart.yaml | 6 +++--- charts/sophora-image-access-service/Chart.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/sophora-admin-dashboard/Chart.yaml b/charts/sophora-admin-dashboard/Chart.yaml index e821fe2b..c1317951 100644 --- a/charts/sophora-admin-dashboard/Chart.yaml +++ b/charts/sophora-admin-dashboard/Chart.yaml @@ -13,8 +13,8 @@ icon: https://subshell.com/logos/admindashboard104~1x1.1683631966185.png # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.0 +version: 1.7.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API" + - kind: changed + description: "HTTPRoute configuration changed to support a list of routes via httpRoutes[]. The previous httpRoute field have been removed (breaking change)!" diff --git a/charts/sophora-image-access-service/Chart.yaml b/charts/sophora-image-access-service/Chart.yaml index 3433b4e0..e1579f32 100644 --- a/charts/sophora-image-access-service/Chart.yaml +++ b/charts/sophora-image-access-service/Chart.yaml @@ -15,11 +15,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.6.0 +version: 1.7.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added affinity" + - kind: changed + description: "HTTPRoute configuration changed to support a list of routes" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to From 1f321ef016ba6709fa9d59568d75fda09cdc0080 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 10:53:01 +0200 Subject: [PATCH 03/14] use map instead of list --- charts/sophora-admin-dashboard/Chart.yaml | 2 +- .../templates/httproute.yaml | 4 +- .../tests/httproute_test.yaml | 8 +-- .../tests/values/httproute.yaml | 50 +++++++++--------- charts/sophora-admin-dashboard/values.yaml | 48 ++++++++--------- .../sophora-image-access-service/Chart.yaml | 2 +- .../templates/httproute.yaml | 4 +- .../tests/httproute_test.yaml | 8 +-- .../tests/values/httproute.yaml | 50 +++++++++--------- .../sophora-image-access-service/values.yaml | 51 +++++++++---------- 10 files changed, 116 insertions(+), 111 deletions(-) diff --git a/charts/sophora-admin-dashboard/Chart.yaml b/charts/sophora-admin-dashboard/Chart.yaml index c1317951..bda5bd84 100644 --- a/charts/sophora-admin-dashboard/Chart.yaml +++ b/charts/sophora-admin-dashboard/Chart.yaml @@ -17,4 +17,4 @@ version: 1.7.0 annotations: artifacthub.io/changes: | - kind: changed - description: "HTTPRoute configuration changed to support a list of routes via httpRoutes[]. The previous httpRoute field have been removed (breaking change)!" + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" diff --git a/charts/sophora-admin-dashboard/templates/httproute.yaml b/charts/sophora-admin-dashboard/templates/httproute.yaml index 132094ae..956eb5d6 100644 --- a/charts/sophora-admin-dashboard/templates/httproute.yaml +++ b/charts/sophora-admin-dashboard/templates/httproute.yaml @@ -1,10 +1,10 @@ {{- $fullName := include "sophora-admin-dashboard.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $index, $httpRoute := .Values.httpRoutes }} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}{{ eq $index 0 | ternary "" (printf "-%d" $index) }} + name: {{ $fullName }}-{{ $key }} labels: {{- include "sophora-admin-dashboard.labels" $ | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-admin-dashboard/tests/httproute_test.yaml b/charts/sophora-admin-dashboard/tests/httproute_test.yaml index e6773a33..4ffbc095 100644 --- a/charts/sophora-admin-dashboard/tests/httproute_test.yaml +++ b/charts/sophora-admin-dashboard/tests/httproute_test.yaml @@ -20,16 +20,16 @@ tests: - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-admin-dashboard + name: values-test-release-sophora-admin-dashboard-primary - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-admin-dashboard-1 + name: values-test-release-sophora-admin-dashboard-secondary - equal: documentIndex: 0 path: metadata value: - name: values-test-release-sophora-admin-dashboard + name: values-test-release-sophora-admin-dashboard-primary labels: helm.sh/chart: sophora-admin-dashboard-0.9.8 app.kubernetes.io/name: sophora-admin-dashboard @@ -65,7 +65,7 @@ tests: - equal: documentIndex: 1 path: metadata.name - value: values-test-release-sophora-admin-dashboard-1 + value: values-test-release-sophora-admin-dashboard-secondary - equal: documentIndex: 1 path: spec.hostnames diff --git a/charts/sophora-admin-dashboard/tests/values/httproute.yaml b/charts/sophora-admin-dashboard/tests/values/httproute.yaml index 09e4411d..ee550638 100644 --- a/charts/sophora-admin-dashboard/tests/values/httproute.yaml +++ b/charts/sophora-admin-dashboard/tests/values/httproute.yaml @@ -1,25 +1,27 @@ httpRoutes: -- parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value -- parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - second.example.com \ No newline at end of file + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-admin-dashboard/values.yaml b/charts/sophora-admin-dashboard/values.yaml index 6aa5b01b..e44b8903 100644 --- a/charts/sophora-admin-dashboard/values.yaml +++ b/charts/sophora-admin-dashboard/values.yaml @@ -208,29 +208,31 @@ ingress: # hosts: # - chart-example.local -# httpRoutes List of HTTPRoute resources (Gateway API) to create -httpRoutes: [] - # httpRoutes[0].parentRefs References to the Gateway resources that the HTTPRoute should attach to - #- parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - # httpRoutes[0].hostnames Array with hostnames used for the HTTPRoute - # hostnames: - # - "my-service.example.com" - # httpRoutes[0].matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - # httpRoutes[0].filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - # httpRoutes[0].annotations annotations for the HTTPRoute - # annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "primary" -> "-primary". +httpRoutes: {} + # primary: + # # httpRoutes.primary.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.primary.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.primary.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: /sophora.srpc + # # httpRoutes.primary.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.primary.annotations annotations for the HTTPRoute + # annotations: {} resources: requests: diff --git a/charts/sophora-image-access-service/Chart.yaml b/charts/sophora-image-access-service/Chart.yaml index e1579f32..d0d590e1 100644 --- a/charts/sophora-image-access-service/Chart.yaml +++ b/charts/sophora-image-access-service/Chart.yaml @@ -19,7 +19,7 @@ version: 1.7.0 annotations: artifacthub.io/changes: | - kind: changed - description: "HTTPRoute configuration changed to support a list of routes" + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute and extraHttpRoutes fields have been removed (breaking change)!" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sophora-image-access-service/templates/httproute.yaml b/charts/sophora-image-access-service/templates/httproute.yaml index 74693614..409d1c79 100644 --- a/charts/sophora-image-access-service/templates/httproute.yaml +++ b/charts/sophora-image-access-service/templates/httproute.yaml @@ -1,10 +1,10 @@ {{ $fullName := include "access-service.fullname" $ -}} {{ $svcPort := $.Values.service.httpPort -}} -{{ range $index, $httpRoute := .Values.httpRoutes -}} +{{ range $key, $httpRoute := .Values.httpRoutes -}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}{{ eq $index 0 | ternary "" (printf "-%d" $index) }} + name: {{ $fullName }}-{{ $key }} labels: {{- include "access-service.labels" $ | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-image-access-service/tests/httproute_test.yaml b/charts/sophora-image-access-service/tests/httproute_test.yaml index 2e136100..a61f149b 100644 --- a/charts/sophora-image-access-service/tests/httproute_test.yaml +++ b/charts/sophora-image-access-service/tests/httproute_test.yaml @@ -21,16 +21,16 @@ tests: - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: sophora-image-access-service + name: sophora-image-access-service-primary - containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: sophora-image-access-service-1 + name: sophora-image-access-service-secondary - equal: documentIndex: 0 path: metadata value: - name: sophora-image-access-service + name: sophora-image-access-service-primary labels: helm.sh/chart: sophora-image-access-service-0.9.8 app.kubernetes.io/name: sophora-image-access-service @@ -67,7 +67,7 @@ tests: - equal: documentIndex: 1 path: metadata.name - value: sophora-image-access-service-1 + value: sophora-image-access-service-secondary - equal: documentIndex: 1 path: spec.hostnames diff --git a/charts/sophora-image-access-service/tests/values/httproute.yaml b/charts/sophora-image-access-service/tests/values/httproute.yaml index 09e4411d..ee550638 100644 --- a/charts/sophora-image-access-service/tests/values/httproute.yaml +++ b/charts/sophora-image-access-service/tests/values/httproute.yaml @@ -1,25 +1,27 @@ httpRoutes: -- parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value -- parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - second.example.com \ No newline at end of file + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-image-access-service/values.yaml b/charts/sophora-image-access-service/values.yaml index bc2f4bbb..7d707cff 100644 --- a/charts/sophora-image-access-service/values.yaml +++ b/charts/sophora-image-access-service/values.yaml @@ -81,32 +81,31 @@ extraIngress: [] # hosts: # tls: [] -# httpRoutes List of HTTPRoute resources (Gateway API) to create -httpRoutes: [] - # httpRoutes[0].parentRefs References to the Gateway resources that the HTTPRoute should attach to - #- parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - # httpRoutes[0].hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - # httpRoutes[0].matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: / - # httpRoutes[0].filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - # httpRoutes[0].annotations annotations for the HTTPRoute - # annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "primary" -> "-primary". +httpRoutes: {} + # primary: + # # httpRoutes.primary.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.primary.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.primary.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.primary.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.primary.annotations annotations for the HTTPRoute + # annotations: {} serviceAccount: create: false From ea92c1fe532dcb9d33a65cf9fee372756477ccb6 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 11:17:02 +0200 Subject: [PATCH 04/14] fix unittest for sophora-admin-dashboard --- .../tests/httproute_test.yaml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/charts/sophora-admin-dashboard/tests/httproute_test.yaml b/charts/sophora-admin-dashboard/tests/httproute_test.yaml index 4ffbc095..4d21a378 100644 --- a/charts/sophora-admin-dashboard/tests/httproute_test.yaml +++ b/charts/sophora-admin-dashboard/tests/httproute_test.yaml @@ -17,16 +17,8 @@ tests: asserts: - hasDocuments: count: 2 - - containsDocument: - kind: HTTPRoute - apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-admin-dashboard-primary - - containsDocument: - kind: HTTPRoute - apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-admin-dashboard-secondary - - equal: - documentIndex: 0 + - documentIndex: 0 + equal: path: metadata value: name: values-test-release-sophora-admin-dashboard-primary @@ -38,8 +30,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: - documentIndex: 0 + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -62,13 +54,21 @@ tests: - path: type: PathPrefix value: / - - equal: - documentIndex: 1 + - documentIndex: 1 + equal: path: metadata.name value: values-test-release-sophora-admin-dashboard-secondary - - equal: - documentIndex: 1 - path: spec.hostnames + - documentIndex: 1 + equal: + path: spec value: - - second.example.com - - notFailedTemplate: {} \ No newline at end of file + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-admin-dashboard + port: 80 + - notFailedTemplate: {} From a76faf75255c2eb22333dc6fbc02c97393626766 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 11:24:28 +0200 Subject: [PATCH 05/14] fix unittest for sophora-image-access-service --- .../tests/httproute_test.yaml | 20 ++++++++- .../tests/httproute_test.yaml | 45 +++++++++++++------ 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/charts/sophora-admin-dashboard/tests/httproute_test.yaml b/charts/sophora-admin-dashboard/tests/httproute_test.yaml index 4d21a378..7ea3a220 100644 --- a/charts/sophora-admin-dashboard/tests/httproute_test.yaml +++ b/charts/sophora-admin-dashboard/tests/httproute_test.yaml @@ -17,6 +17,16 @@ tests: asserts: - hasDocuments: count: 2 + - documentIndex: 0 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-admin-dashboard-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-admin-dashboard-secondary - documentIndex: 0 equal: path: metadata @@ -56,8 +66,14 @@ tests: value: / - documentIndex: 1 equal: - path: metadata.name - value: values-test-release-sophora-admin-dashboard-secondary + path: metadata + value: + name: values-test-release-sophora-admin-dashboard-secondary + labels: + helm.sh/chart: sophora-admin-dashboard-0.9.8 + app.kubernetes.io/name: sophora-admin-dashboard + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm - documentIndex: 1 equal: path: spec diff --git a/charts/sophora-image-access-service/tests/httproute_test.yaml b/charts/sophora-image-access-service/tests/httproute_test.yaml index a61f149b..7e3b588e 100644 --- a/charts/sophora-image-access-service/tests/httproute_test.yaml +++ b/charts/sophora-image-access-service/tests/httproute_test.yaml @@ -18,16 +18,18 @@ tests: asserts: - hasDocuments: count: 2 - - containsDocument: + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 name: sophora-image-access-service-primary - - containsDocument: + - documentIndex: 1 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 name: sophora-image-access-service-secondary - - equal: - documentIndex: 0 + - documentIndex: 0 + equal: path: metadata value: name: sophora-image-access-service-primary @@ -40,8 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: - documentIndex: 0 + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -64,13 +66,28 @@ tests: - path: type: PathPrefix value: / - - equal: - documentIndex: 1 - path: metadata.name - value: sophora-image-access-service-secondary - - equal: - documentIndex: 1 - path: spec.hostnames + - documentIndex: 1 + equal: + path: metadata + value: + name: sophora-image-access-service-secondary + labels: + helm.sh/chart: sophora-image-access-service-0.9.8 + app.kubernetes.io/name: sophora-image-access-service + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec value: - - second.example.com + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: sophora-image-access-service + port: 8080 - notFailedTemplate: {} \ No newline at end of file From bbd034b4017ffa107cd261ed2128078d55e5341d Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 15:50:54 +0200 Subject: [PATCH 06/14] refactorig for easy copy&paste ;) --- charts/sophora-admin-dashboard/templates/httproute.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/sophora-admin-dashboard/templates/httproute.yaml b/charts/sophora-admin-dashboard/templates/httproute.yaml index 956eb5d6..a988ebc4 100644 --- a/charts/sophora-admin-dashboard/templates/httproute.yaml +++ b/charts/sophora-admin-dashboard/templates/httproute.yaml @@ -1,4 +1,5 @@ {{- $fullName := include "sophora-admin-dashboard.fullname" . -}} +{{- $labels := include "sophora-admin-dashboard.labels" . -}} {{- $svcPort := .Values.service.port -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 @@ -6,7 +7,7 @@ kind: HTTPRoute metadata: name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-admin-dashboard.labels" $ | nindent 4 }} + {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} From ef57382f366256040b8e3689fceaaa1274318987 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 16:20:12 +0200 Subject: [PATCH 07/14] changed all HTTPRoutes configurations and templates to use a map --- charts/o-neko-catnip/Chart.yaml | 6 +- charts/o-neko-catnip/templates/httproute.yaml | 30 +++++---- charts/o-neko-catnip/values.yaml | 57 +++++++--------- charts/o-neko/Chart.yaml | 6 +- charts/o-neko/templates/httproute.yaml | 30 +++++---- charts/o-neko/values.yaml | 57 +++++++--------- charts/planr-tools/Chart.yaml | 6 +- charts/planr-tools/templates/httproute.yaml | 57 +++++++--------- charts/planr-tools/values.yaml | 31 +++++++-- charts/sophora-admin-dashboard/values.yaml | 16 ++--- charts/sophora-ai/Chart.yaml | 6 +- charts/sophora-ai/templates/httproute.yaml | 28 ++++---- charts/sophora-ai/values.yaml | 57 +++++++--------- charts/sophora-contentapi/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-contentapi/values.yaml | 57 +++++++--------- .../templates/httproute.yaml | 9 +-- .../sophora-image-access-service/values.yaml | 14 ++-- charts/sophora-image-ai/Chart.yaml | 6 +- .../sophora-image-ai/templates/httproute.yaml | 28 ++++---- charts/sophora-image-ai/values.yaml | 57 +++++++--------- charts/sophora-importer/Chart.yaml | 6 +- .../sophora-importer/templates/httproute.yaml | 36 +++++----- charts/sophora-importer/values.yaml | 65 +++++++------------ charts/sophora-indexing-service/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-indexing-service/values.yaml | 57 +++++++--------- charts/sophora-linkchecker/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-linkchecker/values.yaml | 57 +++++++--------- charts/sophora-media-finder/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-media-finder/values.yaml | 57 +++++++--------- charts/sophora-metadata-supplier/Chart.yaml | 4 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-metadata-supplier/values.yaml | 57 +++++++--------- charts/sophora-schema-docs/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-schema-docs/values.yaml | 57 +++++++--------- charts/sophora-seo-check/Chart.yaml | 6 +- .../templates/httproute.yaml | 28 ++++---- charts/sophora-seo-check/values.yaml | 57 +++++++--------- charts/sophora-server/Chart.yaml | 6 +- .../sophora-server/templates/httproute.yaml | 30 +++++---- charts/sophora-server/values.yaml | 57 +++++++--------- charts/sophora-ugc/Chart.yaml | 6 +- charts/sophora-ugc/templates/httproute.yaml | 28 ++++---- charts/sophora-ugc/values.yaml | 57 +++++++--------- charts/sophora-webclient/Chart.yaml | 6 +- .../templates/httproute.yaml | 25 +++---- charts/sophora-webclient/values.yaml | 57 +++++++--------- charts/sophora-youtube-connector/Chart.yaml | 6 +- .../templates/httproute.yaml | 26 ++++---- charts/sophora-youtube-connector/values.yaml | 57 +++++++--------- 54 files changed, 764 insertions(+), 840 deletions(-) diff --git a/charts/o-neko-catnip/Chart.yaml b/charts/o-neko-catnip/Chart.yaml index b303bb3b..7e55a3d9 100644 --- a/charts/o-neko-catnip/Chart.yaml +++ b/charts/o-neko-catnip/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: o-neko-catnip description: A Helm chart for the O-Neko URL trigger type: application -version: 1.4.0 +version: 1.5.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API" + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: "1.3.2" sources: diff --git a/charts/o-neko-catnip/templates/httproute.yaml b/charts/o-neko-catnip/templates/httproute.yaml index 56da5449..1edb3556 100644 --- a/charts/o-neko-catnip/templates/httproute.yaml +++ b/charts/o-neko-catnip/templates/httproute.yaml @@ -1,35 +1,39 @@ -{{- if .Values.httpRoute.enabled -}} {{- $fullName := include "o-neko-catnip.fullname" . -}} +{{- $labels := include "o-neko-catnip.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - labels: {{- include "o-neko-catnip.labels" . | nindent 4 }} - name: {{ $fullName }} - {{- with .Values.httpRoute.annotations }} + name: {{ $fullName }}-{{ $key }} + labels: + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} - - {{ required "A hostname for the HTTPRoute must be provided in .Values.httpRoute.hostnames" . | quote }} + {{- range $httpRoute.hostnames }} + - {{ . | quote }} {{- end }} {{- end }} rules: - backendRefs: - name: {{ $fullName }} - port: 8080 - {{- with .Values.httpRoute.matches }} + port: {{ $svcPort }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/o-neko-catnip/values.yaml b/charts/o-neko-catnip/values.yaml index 282e7730..1b082914 100644 --- a/charts/o-neko-catnip/values.yaml +++ b/charts/o-neko-catnip/values.yaml @@ -119,38 +119,31 @@ ingress: defaultBackend: enabled: false -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} ## @section Metrics and Alerting ## diff --git a/charts/o-neko/Chart.yaml b/charts/o-neko/Chart.yaml index 750ee4da..f581de7f 100644 --- a/charts/o-neko/Chart.yaml +++ b/charts/o-neko/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: o-neko description: A Helm chart for O-Neko type: application -version: 2.1.0 +version: 2.2.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API" + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: "1.8.2" sources: diff --git a/charts/o-neko/templates/httproute.yaml b/charts/o-neko/templates/httproute.yaml index bbd7ad89..768dab66 100644 --- a/charts/o-neko/templates/httproute.yaml +++ b/charts/o-neko/templates/httproute.yaml @@ -1,35 +1,39 @@ -{{- if .Values.httpRoute.enabled -}} {{- $fullName := include "o-neko.fullname" . -}} +{{- $labels := include "o-neko.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - labels: {{- include "o-neko.labels" . | nindent 4 }} - name: {{ $fullName }} - {{- with .Values.httpRoute.annotations }} + name: {{ $fullName }}-{{ $key }} + labels: + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} - - {{ required "A hostname for the HTTPRoute must be provided in .Values.httpRoute.hostnames" . | quote }} + {{- range $httpRoute.hostnames }} + - {{ . | quote }} {{- end }} {{- end }} rules: - backendRefs: - name: {{ $fullName }} - port: 8080 - {{- with .Values.httpRoute.matches }} + port: {{ $svcPort }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/o-neko/values.yaml b/charts/o-neko/values.yaml index d2f81974..3939032f 100644 --- a/charts/o-neko/values.yaml +++ b/charts/o-neko/values.yaml @@ -148,38 +148,31 @@ ingress: # ingress.annotations annotations for the ingress annotations: {} -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - ## e.g. - ## parentRefs: - ## - name: my-gateway - ## namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - ## e.g. - ## hostnames: - ## - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} ## @section Metrics ## diff --git a/charts/planr-tools/Chart.yaml b/charts/planr-tools/Chart.yaml index cfcafdff..65ea88f7 100644 --- a/charts/planr-tools/Chart.yaml +++ b/charts/planr-tools/Chart.yaml @@ -2,12 +2,12 @@ apiVersion: v2 name: planr-tools description: A Helm chart for deploying the planr-tools applications type: application -version: 1.0.0 +version: 1.1.0 appVersion: "5.1.1" annotations: artifacthub.io/changes: | - - kind: added - description: Initial release of the planr-tools chart. + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" sources: - https://github.com/subshell/helm-charts/tree/main/charts/planr-tools home: https://gitlab.com/subshell/kunden/planr-tools diff --git a/charts/planr-tools/templates/httproute.yaml b/charts/planr-tools/templates/httproute.yaml index b94e5e08..d2647de6 100644 --- a/charts/planr-tools/templates/httproute.yaml +++ b/charts/planr-tools/templates/httproute.yaml @@ -1,48 +1,39 @@ -{{- if .Values.httpRoute.enabled }} +{{- $fullName := include "planr-tools.fullname" . }} +{{- $labels := include "planr-tools.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ include "planr-tools.fullname" . }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "planr-tools.labels" (dict "root" . "component" (dict "name" "gateway")) | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} - {{- with .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range . }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} - {{- end }} + {{- end }} {{- end }} rules: - {{- range $appKey := (include "planr-tools.app-keys" $ | fromYaml).keys }} - {{- $component := index $.Values.applications $appKey }} - {{- if $component.enabled }} - - matches: - - path: - type: PathPrefix - value: {{ $component.exposure.path | quote }} - backendRefs: - - name: {{ include "planr-tools.componentFullname" (dict "root" $ "component" $component) }} - port: {{ $component.service.port }} + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- with $httpRoute.matches }} + matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $httpRoute.filters }} filters: - {{- if ne $component.exposure.path "/" }} - {{/* Strip the path prefix so apps receive requests at their own root, same as the Ingress rewrite. */}} - - type: URLRewrite - urlRewrite: - path: - type: ReplacePrefixMatch - replacePrefixMatch: / - {{- end }} - {{- with $.Values.httpRoute.filters }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} + {{- toYaml . | nindent 8 }} + {{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/planr-tools/values.yaml b/charts/planr-tools/values.yaml index 0fe3f192..76da710b 100644 --- a/charts/planr-tools/values.yaml +++ b/charts/planr-tools/values.yaml @@ -53,12 +53,31 @@ ingress: hosts: annotations: {} -httpRoute: - enabled: false - parentRefs: [] - hostnames: [] - filters: [] - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} applications: documentCreator: diff --git a/charts/sophora-admin-dashboard/values.yaml b/charts/sophora-admin-dashboard/values.yaml index e44b8903..f587b2c3 100644 --- a/charts/sophora-admin-dashboard/values.yaml +++ b/charts/sophora-admin-dashboard/values.yaml @@ -209,29 +209,29 @@ ingress: # - chart-example.local # httpRoutes Map of HTTPRoute resources (Gateway API) to create. -# The map key is used as a suffix for the resource name, e.g. "primary" -> "-primary". +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". httpRoutes: {} - # primary: - # # httpRoutes.primary.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to # parentRefs: # - name: my-gateway # namespace: gateway-namespace - # # httpRoutes.primary.hostnames Array with hostnames used for the HTTPRoute + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute # hostnames: # - "my-service.example.com" - # # httpRoutes.primary.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests # matches: # - path: # type: PathPrefix - # value: /sophora.srpc - # # httpRoutes.primary.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses # filters: # - type: RequestHeaderModifier # requestHeaderModifier: # set: # - name: X-Custom-Header # value: custom-value - # # httpRoutes.primary.annotations annotations for the HTTPRoute + # # httpRoutes.web.annotations annotations for the HTTPRoute # annotations: {} resources: diff --git a/charts/sophora-ai/Chart.yaml b/charts/sophora-ai/Chart.yaml index a9a87925..1bd3f1a7 100644 --- a/charts/sophora-ai/Chart.yaml +++ b/charts/sophora-ai/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-ai description: Sophora AI type: application -version: 2.3.0 +version: 2.4.0 annotations: artifacthub.io/changes: | - - kind: added - description: added configuration for the upcoming Spell Check feature (requires Sophora AI >1.7.0) + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 1.7.0 sources: - https://github.com/subshell/helm-charts/tree/main/charts/sophora-ai diff --git a/charts/sophora-ai/templates/httproute.yaml b/charts/sophora-ai/templates/httproute.yaml index 499acc76..e184b005 100644 --- a/charts/sophora-ai/templates/httproute.yaml +++ b/charts/sophora-ai/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-ai.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-ai.fullname" . -}} +{{- $labels := include "sophora-ai.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-ai.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-ai/values.yaml b/charts/sophora-ai/values.yaml index 95775642..364316cf 100644 --- a/charts/sophora-ai/values.yaml +++ b/charts/sophora-ai/values.yaml @@ -219,38 +219,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-contentapi/Chart.yaml b/charts/sophora-contentapi/Chart.yaml index caaea069..bdf1f0ee 100644 --- a/charts/sophora-contentapi/Chart.yaml +++ b/charts/sophora-contentapi/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-contentapi description: Sophora Content API type: application -version: 1.1.0 +version: 1.2.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 6.0.0 sources: diff --git a/charts/sophora-contentapi/templates/httproute.yaml b/charts/sophora-contentapi/templates/httproute.yaml index 56e0efbc..327acc80 100644 --- a/charts/sophora-contentapi/templates/httproute.yaml +++ b/charts/sophora-contentapi/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-contentapi.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-contentapi.fullname" . -}} +{{- $labels := include "sophora-content-api.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-contentapi.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-contentapi/values.yaml b/charts/sophora-contentapi/values.yaml index a36fe0af..7b549547 100644 --- a/charts/sophora-contentapi/values.yaml +++ b/charts/sophora-contentapi/values.yaml @@ -70,38 +70,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-image-access-service/templates/httproute.yaml b/charts/sophora-image-access-service/templates/httproute.yaml index 409d1c79..958e5a12 100644 --- a/charts/sophora-image-access-service/templates/httproute.yaml +++ b/charts/sophora-image-access-service/templates/httproute.yaml @@ -1,15 +1,16 @@ {{ $fullName := include "access-service.fullname" $ -}} -{{ $svcPort := $.Values.service.httpPort -}} -{{ range $key, $httpRoute := .Values.httpRoutes -}} +{{- $labels := include "access-service.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: {{ $fullName }}-{{ $key }} labels: - {{- include "access-service.labels" $ | nindent 4 }} + {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: {{- with $httpRoute.parentRefs }} diff --git a/charts/sophora-image-access-service/values.yaml b/charts/sophora-image-access-service/values.yaml index 7d707cff..1cb593ed 100644 --- a/charts/sophora-image-access-service/values.yaml +++ b/charts/sophora-image-access-service/values.yaml @@ -82,29 +82,29 @@ extraIngress: [] # tls: [] # httpRoutes Map of HTTPRoute resources (Gateway API) to create. -# The map key is used as a suffix for the resource name, e.g. "primary" -> "-primary". +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". httpRoutes: {} - # primary: - # # httpRoutes.primary.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to # parentRefs: # - name: my-gateway # namespace: gateway-namespace - # # httpRoutes.primary.hostnames Array with hostnames used for the HTTPRoute + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute # hostnames: # - "my-service.example.com" - # # httpRoutes.primary.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests # matches: # - path: # type: PathPrefix # value: / - # # httpRoutes.primary.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses # filters: # - type: RequestHeaderModifier # requestHeaderModifier: # set: # - name: X-Custom-Header # value: custom-value - # # httpRoutes.primary.annotations annotations for the HTTPRoute + # # httpRoutes.web.annotations annotations for the HTTPRoute # annotations: {} serviceAccount: diff --git a/charts/sophora-image-ai/Chart.yaml b/charts/sophora-image-ai/Chart.yaml index a7b52ea1..8bbb6f55 100644 --- a/charts/sophora-image-ai/Chart.yaml +++ b/charts/sophora-image-ai/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-image-ai description: Sophora Image AI type: application -version: 2.2.0 +version: 2.3.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 5.1.0 sources: diff --git a/charts/sophora-image-ai/templates/httproute.yaml b/charts/sophora-image-ai/templates/httproute.yaml index d0716f24..78bedb58 100644 --- a/charts/sophora-image-ai/templates/httproute.yaml +++ b/charts/sophora-image-ai/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-image-ai.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-image-ai.fullname" . -}} +{{- $labels := include "sophora-image-ai.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-image-ai.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-image-ai/values.yaml b/charts/sophora-image-ai/values.yaml index a47c3900..18a2e55f 100644 --- a/charts/sophora-image-ai/values.yaml +++ b/charts/sophora-image-ai/values.yaml @@ -63,38 +63,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-importer/Chart.yaml b/charts/sophora-importer/Chart.yaml index 1831e6c0..aed9d17b 100644 --- a/charts/sophora-importer/Chart.yaml +++ b/charts/sophora-importer/Chart.yaml @@ -15,11 +15,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.6.0 +version: 2.7.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added probes" + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sophora-importer/templates/httproute.yaml b/charts/sophora-importer/templates/httproute.yaml index 19af18bd..fadeefc6 100644 --- a/charts/sophora-importer/templates/httproute.yaml +++ b/charts/sophora-importer/templates/httproute.yaml @@ -1,43 +1,39 @@ -{{- if .Values.httpRoute.enabled -}} {{- $fullName := include "sophora-importer.fullname" . -}} -{{- $svcPort := .Values.service.httpPort -}} -{{- $rules := list (dict) -}} -{{/* backward compatible to version 2.4.x */}} -{{- $firstRule := dict -}} -{{- if .Values.httpRoute.rules -}} - {{- $firstRule = first .Values.httpRoute.rules -}} -{{- else if or .Values.httpRoute.matches .Values.httpRoute.filters -}} - {{- $firstRule = dict "matches" .Values.httpRoute.matches "filters" .Values.httpRoute.filters -}} -{{- end -}} +{{- $labels := include "sophora-importer.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-importer.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- with $httpRoute.parentRefs }} parentRefs: - {{- with .Values.httpRoute.parentRefs }} - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with .Values.httpRoute.hostnames }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- if $httpRoute.hostnames }} hostnames: - {{- toYaml . | nindent 4 }} + {{- range $httpRoute.hostnames }} + - {{ . | quote }} + {{- end }} {{- end }} rules: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with $firstRule.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with $firstRule.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} +--- {{- end }} diff --git a/charts/sophora-importer/values.yaml b/charts/sophora-importer/values.yaml index 92dff86e..61217eed 100644 --- a/charts/sophora-importer/values.yaml +++ b/charts/sophora-importer/values.yaml @@ -152,43 +152,28 @@ additionalVolumeMounts: # This option can be used to create a pvc for the local import folders importPvcSpec: -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.rules !DEPRECATED use matches and filters instead! This will override matches/filters. List of rules and filters applied. - # e.g. - # rules: - # - matches: - # - path: - # type: PathPrefix - # value: /headers - rules: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} diff --git a/charts/sophora-indexing-service/Chart.yaml b/charts/sophora-indexing-service/Chart.yaml index e4760fd3..cf36e5e0 100644 --- a/charts/sophora-indexing-service/Chart.yaml +++ b/charts/sophora-indexing-service/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-indexing-service description: Sophora Indexing Service (SISI) type: application -version: 1.6.0 +version: 1.7.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: '5.4.1' sources: diff --git a/charts/sophora-indexing-service/templates/httproute.yaml b/charts/sophora-indexing-service/templates/httproute.yaml index 3608ff89..f30ab566 100644 --- a/charts/sophora-indexing-service/templates/httproute.yaml +++ b/charts/sophora-indexing-service/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-indexing-service.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-indexing-service.fullname" . -}} +{{- $labels := include "sophora-indexing-service.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-indexing-service.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-indexing-service/values.yaml b/charts/sophora-indexing-service/values.yaml index 1c523275..bb648d0c 100644 --- a/charts/sophora-indexing-service/values.yaml +++ b/charts/sophora-indexing-service/values.yaml @@ -93,38 +93,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} resources: requests: diff --git a/charts/sophora-linkchecker/Chart.yaml b/charts/sophora-linkchecker/Chart.yaml index 86a32604..08bcb6f6 100644 --- a/charts/sophora-linkchecker/Chart.yaml +++ b/charts/sophora-linkchecker/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-linkchecker description: Sophora Link Checker type: application -version: 0.2.0 +version: 0.3.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 6.0.0 sources: diff --git a/charts/sophora-linkchecker/templates/httproute.yaml b/charts/sophora-linkchecker/templates/httproute.yaml index 9a7c459e..5b70586c 100644 --- a/charts/sophora-linkchecker/templates/httproute.yaml +++ b/charts/sophora-linkchecker/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-linkchecker.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-linkchecker.fullname" . -}} +{{- $labels := include "sophora-linkchecker.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-linkchecker.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-linkchecker/values.yaml b/charts/sophora-linkchecker/values.yaml index 88fa796b..3a7fbaa2 100644 --- a/charts/sophora-linkchecker/values.yaml +++ b/charts/sophora-linkchecker/values.yaml @@ -70,38 +70,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-media-finder/Chart.yaml b/charts/sophora-media-finder/Chart.yaml index f1ab8795..ec6c5647 100644 --- a/charts/sophora-media-finder/Chart.yaml +++ b/charts/sophora-media-finder/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-media-finder description: A Helm chart for Sophora Media Finder type: application -version: 0.3.0 +version: 0.4.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: "5.x" sources: diff --git a/charts/sophora-media-finder/templates/httproute.yaml b/charts/sophora-media-finder/templates/httproute.yaml index 370f6b06..9384f9d3 100644 --- a/charts/sophora-media-finder/templates/httproute.yaml +++ b/charts/sophora-media-finder/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-media-finder.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-media-finder.fullname" . -}} +{{- $labels := include "sophora-media-finder.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-media-finder.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-media-finder/values.yaml b/charts/sophora-media-finder/values.yaml index d78003ee..19e87206 100644 --- a/charts/sophora-media-finder/values.yaml +++ b/charts/sophora-media-finder/values.yaml @@ -34,38 +34,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} startupProbe: path: /actuator/health diff --git a/charts/sophora-metadata-supplier/Chart.yaml b/charts/sophora-metadata-supplier/Chart.yaml index aff8d3b9..86cc9502 100644 --- a/charts/sophora-metadata-supplier/Chart.yaml +++ b/charts/sophora-metadata-supplier/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-metadata-supplier description: Sophora Metadata Supplier (SMS) type: application -version: 1.4.1 +version: 1.5.0 annotations: artifacthub.io/changes: | - kind: changed - description: "Alert for job queue ignores low priority queue." + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: '4.14.0' sources: diff --git a/charts/sophora-metadata-supplier/templates/httproute.yaml b/charts/sophora-metadata-supplier/templates/httproute.yaml index 2641c0bc..fbbdd16a 100644 --- a/charts/sophora-metadata-supplier/templates/httproute.yaml +++ b/charts/sophora-metadata-supplier/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-metadata-supplier.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-metadata-supplier.fullname" . -}} +{{- $labels := include "sophora-metadata-supplier.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-metadata-supplier.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-metadata-supplier/values.yaml b/charts/sophora-metadata-supplier/values.yaml index f0284b0b..c5867a19 100644 --- a/charts/sophora-metadata-supplier/values.yaml +++ b/charts/sophora-metadata-supplier/values.yaml @@ -99,38 +99,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} prometheusRule: enabled: false diff --git a/charts/sophora-schema-docs/Chart.yaml b/charts/sophora-schema-docs/Chart.yaml index a02003cc..866f1487 100644 --- a/charts/sophora-schema-docs/Chart.yaml +++ b/charts/sophora-schema-docs/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-schema-docs description: Sophora Schema Docs type: application -version: 2.2.0 +version: 2.3.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 5.0.0 sources: diff --git a/charts/sophora-schema-docs/templates/httproute.yaml b/charts/sophora-schema-docs/templates/httproute.yaml index 5b7c23c0..18f2b5db 100644 --- a/charts/sophora-schema-docs/templates/httproute.yaml +++ b/charts/sophora-schema-docs/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-schema-docs.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-schema-docs.fullname" . -}} +{{- $labels := include "sophora-schema-docs.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-schema-docs.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-schema-docs/values.yaml b/charts/sophora-schema-docs/values.yaml index 008112ef..86bf6cd7 100644 --- a/charts/sophora-schema-docs/values.yaml +++ b/charts/sophora-schema-docs/values.yaml @@ -103,38 +103,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-seo-check/Chart.yaml b/charts/sophora-seo-check/Chart.yaml index b6229407..8d2d9777 100644 --- a/charts/sophora-seo-check/Chart.yaml +++ b/charts/sophora-seo-check/Chart.yaml @@ -2,11 +2,11 @@ apiVersion: v2 name: sophora-seo-check description: Sophora SEO Check type: application -version: 1.1.0 +version: 1.2.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added HTTPRoute support for Gateway API." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" appVersion: 4.12.0 sources: diff --git a/charts/sophora-seo-check/templates/httproute.yaml b/charts/sophora-seo-check/templates/httproute.yaml index 2a3e3f32..90bbb8d4 100644 --- a/charts/sophora-seo-check/templates/httproute.yaml +++ b/charts/sophora-seo-check/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-seo-check.fullname" . -}} - {{- $svcPort := .Values.service.port -}} +{{- $fullName := include "sophora-seo-check.fullname" . -}} +{{- $labels := include "sophora-seo-check.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-seo-check.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-seo-check/values.yaml b/charts/sophora-seo-check/values.yaml index 46cac0b1..64758347 100644 --- a/charts/sophora-seo-check/values.yaml +++ b/charts/sophora-seo-check/values.yaml @@ -54,38 +54,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} extraDeploy: [] diff --git a/charts/sophora-server/Chart.yaml b/charts/sophora-server/Chart.yaml index f5cd1fab..04ba74f3 100644 --- a/charts/sophora-server/Chart.yaml +++ b/charts/sophora-server/Chart.yaml @@ -15,11 +15,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 3.3.0 +version: 3.4.0 annotations: artifacthub.io/changes: | - - kind: "added" - description: "Added configuration for single volume support." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sophora-server/templates/httproute.yaml b/charts/sophora-server/templates/httproute.yaml index 3d922fb3..15b5acf2 100644 --- a/charts/sophora-server/templates/httproute.yaml +++ b/charts/sophora-server/templates/httproute.yaml @@ -1,35 +1,39 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-server.fullname" . -}} +{{- $fullName := include "sophora-server.fullname" . -}} +{{- $labels := include "sophora-server.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} - labels: {{ include "sophora-server.topLevelLabels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + name: {{ $fullName }}-{{ $key }} + labels: + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} rules: - backendRefs: - name: {{ $fullName }} - port: {{ .Values.sophora.server.ports.http }} - {{- with .Values.httpRoute.matches }} + port: {{ $svcPort }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-server/values.yaml b/charts/sophora-server/values.yaml index 448db7a9..4c9a48af 100644 --- a/charts/sophora-server/values.yaml +++ b/charts/sophora-server/values.yaml @@ -386,38 +386,31 @@ grpcIngress: # hosts: # - chart-example.local -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # httpRoute.matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: / - matches: [] - # httpRoute.filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} # This can be used to configure a different HttpRoute for the SRPC service as it might require different settings. Can be used with the same hostname as httpRoute, see https://gateway-api.sigs.k8s.io/api-types/grpcroute/#cross-serving. # The SRPC-communication relies on gRPC as communication protocol and e.g. nginx needs to be explicitly informed that the backend protocol is gRPC diff --git a/charts/sophora-ugc/Chart.yaml b/charts/sophora-ugc/Chart.yaml index fe38098f..b7e49f21 100644 --- a/charts/sophora-ugc/Chart.yaml +++ b/charts/sophora-ugc/Chart.yaml @@ -15,11 +15,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.2.0 +version: 2.3.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added host aliases support." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" artifacthub.io/links: | - name: Documentation for Sophora UGC url: https://subshell.com/docs/ugc/ diff --git a/charts/sophora-ugc/templates/httproute.yaml b/charts/sophora-ugc/templates/httproute.yaml index efe759a5..31ebae85 100644 --- a/charts/sophora-ugc/templates/httproute.yaml +++ b/charts/sophora-ugc/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-ugc.fullname" . -}} - {{- $svcPort := default 8080 ($.Values.ugc.config.server).port -}} +{{- $fullName := include "sophora-ugc.fullname" . -}} +{{- $labels := include "sophora-ugc.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-ugc.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-ugc/values.yaml b/charts/sophora-ugc/values.yaml index dc948859..dd47f066 100644 --- a/charts/sophora-ugc/values.yaml +++ b/charts/sophora-ugc/values.yaml @@ -24,38 +24,31 @@ ingress: hosts: annotations: {} -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} authentication: secret: diff --git a/charts/sophora-webclient/Chart.yaml b/charts/sophora-webclient/Chart.yaml index 8fd6cff1..7c3d3b25 100644 --- a/charts/sophora-webclient/Chart.yaml +++ b/charts/sophora-webclient/Chart.yaml @@ -6,11 +6,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.5.1 +version: 1.6.0 annotations: artifacthub.io/changes: | - - kind: fixed - description: "Fixed port of Ingress backend." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/sophora-webclient/templates/httproute.yaml b/charts/sophora-webclient/templates/httproute.yaml index 0f8820e3..39a7f0a4 100644 --- a/charts/sophora-webclient/templates/httproute.yaml +++ b/charts/sophora-webclient/templates/httproute.yaml @@ -1,36 +1,39 @@ -{{- if .Values.httpRoute.enabled -}} {{- $fullName := include "webclient.fullname" . -}} +{{- $labels := include "webclient.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "webclient.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} rules: - backendRefs: - name: {{ $fullName }} - port: {{ .Values.service.port }} - {{- with .Values.httpRoute.matches }} + port: {{ $svcPort }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} +--- +{{- end }} \ No newline at end of file diff --git a/charts/sophora-webclient/values.yaml b/charts/sophora-webclient/values.yaml index cb800fd8..e93fafd1 100644 --- a/charts/sophora-webclient/values.yaml +++ b/charts/sophora-webclient/values.yaml @@ -50,38 +50,31 @@ ingress: hosts: annotations: {} -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} service: type: ClusterIP diff --git a/charts/sophora-youtube-connector/Chart.yaml b/charts/sophora-youtube-connector/Chart.yaml index ef2aa418..f298c46c 100644 --- a/charts/sophora-youtube-connector/Chart.yaml +++ b/charts/sophora-youtube-connector/Chart.yaml @@ -15,11 +15,11 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.4.0 +version: 1.5.0 annotations: artifacthub.io/changes: | - - kind: added - description: "Added extraInitContainers variable." + - kind: changed + description: "HTTPRoute configuration changed to a map of routes via httpRoutes{}. The previous httpRoute field has been removed (breaking change)!" artifacthub.io/links: | - name: Documentation for the AV Tool url: https://subshell.com/docs/avtool/ diff --git a/charts/sophora-youtube-connector/templates/httproute.yaml b/charts/sophora-youtube-connector/templates/httproute.yaml index 0b1ba4af..f0adcde0 100644 --- a/charts/sophora-youtube-connector/templates/httproute.yaml +++ b/charts/sophora-youtube-connector/templates/httproute.yaml @@ -1,24 +1,25 @@ -{{- if .Values.httpRoute.enabled -}} - {{- $fullName := include "sophora-youtube-connector.fullname" . -}} - {{- $svcPort := .Values.service.httpPort -}} +{{- $fullName := include "sophora-youtube-connector.fullname" . -}} +{{- $labels := include "sophora-youtube-connector.labels" . -}} +{{- $svcPort := .Values.service.port -}} +{{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }} + name: {{ $fullName }}-{{ $key }} labels: - {{- include "sophora-youtube-connector.labels" . | nindent 4 }} - {{- with .Values.httpRoute.annotations }} + {{- $labels | nindent 4 }} + {{- with $httpRoute.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.httpRoute.parentRefs }} + {{- with $httpRoute.parentRefs }} parentRefs: {{- toYaml . | nindent 4 }} {{- end }} - {{- if .Values.httpRoute.hostnames }} + {{- if $httpRoute.hostnames }} hostnames: - {{- range .Values.httpRoute.hostnames }} + {{- range $httpRoute.hostnames }} - {{ . | quote }} {{- end }} {{- end }} @@ -26,12 +27,13 @@ spec: - backendRefs: - name: {{ $fullName }} port: {{ $svcPort }} - {{- with .Values.httpRoute.matches }} + {{- with $httpRoute.matches }} matches: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.httpRoute.filters }} + {{- with $httpRoute.filters }} filters: {{- toYaml . | nindent 8 }} {{- end }} +--- {{- end }} diff --git a/charts/sophora-youtube-connector/values.yaml b/charts/sophora-youtube-connector/values.yaml index 656355b9..683bb4a5 100644 --- a/charts/sophora-youtube-connector/values.yaml +++ b/charts/sophora-youtube-connector/values.yaml @@ -46,38 +46,31 @@ ingress: hosts: tls: [] -httpRoute: - # httpRoute.enabled Whether to create an HTTPRoute resource (Gateway API) - enabled: false - # httpRoute.parentRefs References to the Gateway resources that the HTTPRoute should attach to - # e.g. - # parentRefs: - # - name: my-gateway - # namespace: gateway-namespace - parentRefs: [] - # httpRoute.hostnames Array with hostnames used for the HTTPRoute - # e.g. - # hostnames: - # - "my-service.example.com" - hostnames: [] - # matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # e.g. - # matches: - # - path: - # type: PathPrefix - # value: /sophora.srpc - matches: [] - # filters Optional array of HTTPRouteFilter objects for modifying requests/responses - # e.g. - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: X-Custom-Header - # value: custom-value - filters: [] - # httpRoute.annotations annotations for the HTTPRoute - annotations: {} +# httpRoutes Map of HTTPRoute resources (Gateway API) to create. +# The map key is used as a suffix for the resource name, e.g. "web" -> "-web". +httpRoutes: {} + # web: + # # httpRoutes.web.parentRefs References to the Gateway resources that the HTTPRoute should attach to + # parentRefs: + # - name: my-gateway + # namespace: gateway-namespace + # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute + # hostnames: + # - "my-service.example.com" + # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests + # matches: + # - path: + # type: PathPrefix + # value: / + # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: X-Custom-Header + # value: custom-value + # # httpRoutes.web.annotations annotations for the HTTPRoute + # annotations: {} serviceAccount: create: From 1fceede022d2ee247a56f3be9c88c87e522f2f3a Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Tue, 2 Jun 2026 17:51:26 +0200 Subject: [PATCH 08/14] update unittests for changed httproutes --- charts/o-neko-catnip/templates/httproute.yaml | 2 +- .../o-neko-catnip/tests/httproute_test.yaml | 46 ++++- .../o-neko-catnip/tests/values/httproute.yaml | 48 ++--- charts/o-neko/templates/httproute.yaml | 2 +- charts/o-neko/tests/httproute_test.yaml | 46 ++++- charts/o-neko/tests/values/httproute.yaml | 48 ++--- charts/planr-tools/templates/httproute.yaml | 28 ++- charts/planr-tools/tests/httproute_test.yaml | 177 ++++++++++++++---- .../planr-tools/tests/values/httproute.yaml | 28 ++- charts/planr-tools/values.yaml | 5 - charts/sophora-ai/tests/httproute_test.yaml | 46 ++++- charts/sophora-ai/tests/values/httproute.yaml | 48 ++--- .../templates/httproute.yaml | 2 +- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../templates/httproute.yaml | 2 +- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../sophora-importer/templates/httproute.yaml | 2 +- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../sophora-server/templates/httproute.yaml | 2 +- .../sophora-server/tests/httproute_test.yaml | 50 ++++- .../tests/values/httproute.yaml | 48 ++--- charts/sophora-ugc/templates/httproute.yaml | 2 +- charts/sophora-ugc/tests/httproute_test.yaml | 46 ++++- .../sophora-ugc/tests/values/httproute.yaml | 48 ++--- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- .../templates/httproute.yaml | 2 +- .../tests/httproute_test.yaml | 46 ++++- .../tests/values/httproute.yaml | 48 ++--- 42 files changed, 1179 insertions(+), 489 deletions(-) diff --git a/charts/o-neko-catnip/templates/httproute.yaml b/charts/o-neko-catnip/templates/httproute.yaml index 1edb3556..076975aa 100644 --- a/charts/o-neko-catnip/templates/httproute.yaml +++ b/charts/o-neko-catnip/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "o-neko-catnip.fullname" . -}} {{- $labels := include "o-neko-catnip.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := 8080 -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/o-neko-catnip/tests/httproute_test.yaml b/charts/o-neko-catnip/tests/httproute_test.yaml index 514e7179..b55ce5c7 100644 --- a/charts/o-neko-catnip/tests/httproute_test.yaml +++ b/charts/o-neko-catnip/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-o-neko-catnip - - equal: + name: values-test-release-o-neko-catnip-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-o-neko-catnip-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-o-neko-catnip + name: values-test-release-o-neko-catnip-primary labels: helm.sh/chart: o-neko-catnip-0.9.8 app.kubernetes.io/name: o-neko-catnip @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-o-neko-catnip-secondary + labels: + helm.sh/chart: o-neko-catnip-0.9.8 + app.kubernetes.io/name: o-neko-catnip + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-o-neko-catnip + port: 8080 - notFailedTemplate: {} diff --git a/charts/o-neko-catnip/tests/values/httproute.yaml b/charts/o-neko-catnip/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/o-neko-catnip/tests/values/httproute.yaml +++ b/charts/o-neko-catnip/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/o-neko/templates/httproute.yaml b/charts/o-neko/templates/httproute.yaml index 768dab66..c2a797b6 100644 --- a/charts/o-neko/templates/httproute.yaml +++ b/charts/o-neko/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "o-neko.fullname" . -}} {{- $labels := include "o-neko.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := 8080 -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/o-neko/tests/httproute_test.yaml b/charts/o-neko/tests/httproute_test.yaml index 384b2f3d..92ee3fe1 100644 --- a/charts/o-neko/tests/httproute_test.yaml +++ b/charts/o-neko/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-o-neko - - equal: + name: values-test-release-o-neko-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-o-neko-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-o-neko + name: values-test-release-o-neko-primary labels: helm.sh/chart: o-neko-0.9.8 app.kubernetes.io/name: o-neko @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-o-neko-secondary + labels: + helm.sh/chart: o-neko-0.9.8 + app.kubernetes.io/name: o-neko + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-o-neko + port: 8080 - notFailedTemplate: {} diff --git a/charts/o-neko/tests/values/httproute.yaml b/charts/o-neko/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/o-neko/tests/values/httproute.yaml +++ b/charts/o-neko/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/planr-tools/templates/httproute.yaml b/charts/planr-tools/templates/httproute.yaml index d2647de6..a1c0450c 100644 --- a/charts/planr-tools/templates/httproute.yaml +++ b/charts/planr-tools/templates/httproute.yaml @@ -1,6 +1,5 @@ {{- $fullName := include "planr-tools.fullname" . }} -{{- $labels := include "planr-tools.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $labels := include "planr-tools.labels" (dict "root" . "component" (dict "name" "gateway")) -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute @@ -24,16 +23,29 @@ spec: {{- end }} {{- end }} rules: + {{- range $appKey := (include "planr-tools.app-keys" $ | fromYaml).keys }} + {{- $component := index $.Values.applications $appKey }} + {{- if $component.enabled }} - backendRefs: - - name: {{ $fullName }} - port: {{ $svcPort }} - {{- with $httpRoute.matches }} + - name: {{ include "planr-tools.componentFullname" (dict "root" $ "component" $component) }} + port: {{ $component.service.port }} matches: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with $httpRoute.filters }} + - path: + type: PathPrefix + value: {{ $component.exposure.path | quote }} filters: + {{- if ne $component.exposure.path "/" }} + {{/* Strip the path prefix so apps receive requests at their own root, same as the Ingress rewrite. */}} + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: / + {{- end }} + {{- with $httpRoute.filters }} {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} + {{- end }} --- {{- end }} \ No newline at end of file diff --git a/charts/planr-tools/tests/httproute_test.yaml b/charts/planr-tools/tests/httproute_test.yaml index 9359a024..0c504c80 100644 --- a/charts/planr-tools/tests/httproute_test.yaml +++ b/charts/planr-tools/tests/httproute_test.yaml @@ -2,8 +2,8 @@ suite: test httproute templates: - httproute.yaml chart: - version: 1.0.0 - appVersion: 5.1.1 + version: 0.9.8 + appVersion: 1.2.3 tests: - it: should not create httproute by default asserts: @@ -17,43 +17,146 @@ tests: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-planr-tools - - equal: - path: metadata.annotations + name: values-test-release-planr-tools-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-planr-tools-secondary + - documentIndex: 0 + equal: + path: metadata + value: + name: values-test-release-planr-tools-primary + labels: + helm.sh/chart: planr-tools-0.9.8 + app.kubernetes.io/name: planr-tools + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/component: gateway + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + annotations: + example.com/test: "simple" + example.com/text: some text value + - documentIndex: 0 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + rules: + - backendRefs: + - name: values-test-release-planr-tools-newsroom-document-creator + port: 8080 + filters: + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: / + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + matches: + - path: + type: PathPrefix + value: /document-creator + - backendRefs: + - name: values-test-release-planr-tools-newsroom-feed + port: 8081 + filters: + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: / + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + matches: + - path: + type: PathPrefix + value: /feed + - backendRefs: + - name: values-test-release-planr-tools-newsroom-widget + port: 8082 + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + matches: + - path: + type: PathPrefix + value: / + - documentIndex: 1 + equal: + path: metadata value: - example.com/test: "true" - - equal: - path: spec.hostnames + name: values-test-release-planr-tools-secondary + labels: + helm.sh/chart: planr-tools-0.9.8 + app.kubernetes.io/name: planr-tools + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/component: gateway + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec value: - - planr-tools.example.com - - equal: - path: spec.rules[0].backendRefs[0].name - value: values-test-release-planr-tools-newsroom-document-creator - - equal: - path: spec.rules[1].backendRefs[0].name - value: values-test-release-planr-tools-newsroom-feed - - equal: - path: spec.rules[2].backendRefs[0].name - value: values-test-release-planr-tools-newsroom-widget - - equal: - path: spec.rules[0].matches[0].path.value - value: /document-creator - - equal: - path: spec.rules[1].matches[0].path.value - value: /feed - - equal: - path: spec.rules[2].matches[0].path.value - value: / - - equal: - path: spec.rules[0].filters[0].type - value: URLRewrite - - equal: - path: spec.rules[1].filters[0].type - value: URLRewrite - - notExists: - path: spec.rules[2].filters[0].urlRewrite + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-planr-tools-newsroom-document-creator + port: 8080 + filters: + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: / + matches: + - path: + type: PathPrefix + value: /document-creator + - backendRefs: + - name: values-test-release-planr-tools-newsroom-feed + port: 8081 + filters: + - type: URLRewrite + urlRewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: / + matches: + - path: + type: PathPrefix + value: /feed + - backendRefs: + - name: values-test-release-planr-tools-newsroom-widget + port: 8082 + filters: null + matches: + - path: + type: PathPrefix + value: / - notFailedTemplate: {} diff --git a/charts/planr-tools/tests/values/httproute.yaml b/charts/planr-tools/tests/values/httproute.yaml index a3326e67..f5bd901d 100644 --- a/charts/planr-tools/tests/values/httproute.yaml +++ b/charts/planr-tools/tests/values/httproute.yaml @@ -1,15 +1,23 @@ -httpRoute: - enabled: true - parentRefs: +httpRoutes: + primary: + parentRefs: - name: my-gateway namespace: gateway-namespace - hostnames: - - planr-tools.example.com - filters: + hostnames: + - my-service.example.com + - other.example.com + filters: - type: RequestHeaderModifier requestHeaderModifier: set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: "true" + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/planr-tools/values.yaml b/charts/planr-tools/values.yaml index 76da710b..e74e896e 100644 --- a/charts/planr-tools/values.yaml +++ b/charts/planr-tools/values.yaml @@ -64,11 +64,6 @@ httpRoutes: {} # # httpRoutes.web.hostnames Array with hostnames used for the HTTPRoute # hostnames: # - "my-service.example.com" - # # httpRoutes.web.matches Optional array of HTTPRouteMatch objects for matching HTTP requests - # matches: - # - path: - # type: PathPrefix - # value: / # # httpRoutes.web.filters Optional array of HTTPRouteFilter objects for modifying requests/responses # filters: # - type: RequestHeaderModifier diff --git a/charts/sophora-ai/tests/httproute_test.yaml b/charts/sophora-ai/tests/httproute_test.yaml index 5f8b8a0c..bac01425 100644 --- a/charts/sophora-ai/tests/httproute_test.yaml +++ b/charts/sophora-ai/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-ai - - equal: + name: values-test-release-sophora-ai-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-ai-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-ai + name: values-test-release-sophora-ai-primary labels: helm.sh/chart: sophora-ai-0.9.8 app.kubernetes.io/name: sophora-ai @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-ai-secondary + labels: + helm.sh/chart: sophora-ai-0.9.8 + app.kubernetes.io/name: sophora-ai + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-ai + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-ai/tests/values/httproute.yaml b/charts/sophora-ai/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-ai/tests/values/httproute.yaml +++ b/charts/sophora-ai/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-contentapi/templates/httproute.yaml b/charts/sophora-contentapi/templates/httproute.yaml index 327acc80..134d7cc7 100644 --- a/charts/sophora-contentapi/templates/httproute.yaml +++ b/charts/sophora-contentapi/templates/httproute.yaml @@ -1,5 +1,5 @@ {{- $fullName := include "sophora-contentapi.fullname" . -}} -{{- $labels := include "sophora-content-api.labels" . -}} +{{- $labels := include "sophora-contentapi.labels" . -}} {{- $svcPort := .Values.service.port -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 diff --git a/charts/sophora-contentapi/tests/httproute_test.yaml b/charts/sophora-contentapi/tests/httproute_test.yaml index c3c0084b..e59d4bd1 100644 --- a/charts/sophora-contentapi/tests/httproute_test.yaml +++ b/charts/sophora-contentapi/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-contentapi - - equal: + name: values-test-release-sophora-contentapi-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-contentapi-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-contentapi + name: values-test-release-sophora-contentapi-primary labels: helm.sh/chart: sophora-contentapi-0.9.8 app.kubernetes.io/name: sophora-contentapi @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-contentapi-secondary + labels: + helm.sh/chart: sophora-contentapi-0.9.8 + app.kubernetes.io/name: sophora-contentapi + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-contentapi + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-contentapi/tests/values/httproute.yaml b/charts/sophora-contentapi/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-contentapi/tests/values/httproute.yaml +++ b/charts/sophora-contentapi/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-image-access-service/templates/httproute.yaml b/charts/sophora-image-access-service/templates/httproute.yaml index 958e5a12..eadf5283 100644 --- a/charts/sophora-image-access-service/templates/httproute.yaml +++ b/charts/sophora-image-access-service/templates/httproute.yaml @@ -1,6 +1,6 @@ {{ $fullName := include "access-service.fullname" $ -}} {{- $labels := include "access-service.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.httpPort -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/sophora-image-ai/tests/httproute_test.yaml b/charts/sophora-image-ai/tests/httproute_test.yaml index 09bb1691..4663ddb6 100644 --- a/charts/sophora-image-ai/tests/httproute_test.yaml +++ b/charts/sophora-image-ai/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-image-ai - - equal: + name: values-test-release-sophora-image-ai-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-image-ai-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-image-ai + name: values-test-release-sophora-image-ai-primary labels: helm.sh/chart: sophora-image-ai-0.9.8 app.kubernetes.io/name: sophora-image-ai @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-image-ai-secondary + labels: + helm.sh/chart: sophora-image-ai-0.9.8 + app.kubernetes.io/name: sophora-image-ai + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-image-ai + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-image-ai/tests/values/httproute.yaml b/charts/sophora-image-ai/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-image-ai/tests/values/httproute.yaml +++ b/charts/sophora-image-ai/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-importer/templates/httproute.yaml b/charts/sophora-importer/templates/httproute.yaml index fadeefc6..82404476 100644 --- a/charts/sophora-importer/templates/httproute.yaml +++ b/charts/sophora-importer/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "sophora-importer.fullname" . -}} {{- $labels := include "sophora-importer.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.httpPort -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/sophora-importer/tests/httproute_test.yaml b/charts/sophora-importer/tests/httproute_test.yaml index 9dbb5836..dfcc9d04 100644 --- a/charts/sophora-importer/tests/httproute_test.yaml +++ b/charts/sophora-importer/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-importer - - equal: + name: values-test-release-sophora-importer-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-importer-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-importer + name: values-test-release-sophora-importer-primary labels: helm.sh/chart: sophora-importer-0.9.8 app.kubernetes.io/name: sophora-importer @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-importer-secondary + labels: + helm.sh/chart: sophora-importer-0.9.8 + app.kubernetes.io/name: sophora-importer + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-importer + port: 80 - notFailedTemplate: {} diff --git a/charts/sophora-importer/tests/values/httproute.yaml b/charts/sophora-importer/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-importer/tests/values/httproute.yaml +++ b/charts/sophora-importer/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-indexing-service/tests/httproute_test.yaml b/charts/sophora-indexing-service/tests/httproute_test.yaml index de35181c..6170b6a9 100644 --- a/charts/sophora-indexing-service/tests/httproute_test.yaml +++ b/charts/sophora-indexing-service/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-indexing-service - - equal: + name: values-test-release-sophora-indexing-service-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-indexing-service-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-indexing-service + name: values-test-release-sophora-indexing-service-primary labels: helm.sh/chart: sophora-indexing-service-0.9.8 app.kubernetes.io/name: sophora-indexing-service @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-indexing-service-secondary + labels: + helm.sh/chart: sophora-indexing-service-0.9.8 + app.kubernetes.io/name: sophora-indexing-service + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-indexing-service + port: 1837 - notFailedTemplate: {} diff --git a/charts/sophora-indexing-service/tests/values/httproute.yaml b/charts/sophora-indexing-service/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-indexing-service/tests/values/httproute.yaml +++ b/charts/sophora-indexing-service/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-linkchecker/tests/httproute_test.yaml b/charts/sophora-linkchecker/tests/httproute_test.yaml index bb99451c..596c366f 100644 --- a/charts/sophora-linkchecker/tests/httproute_test.yaml +++ b/charts/sophora-linkchecker/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-linkchecker - - equal: + name: values-test-release-sophora-linkchecker-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-linkchecker-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-linkchecker + name: values-test-release-sophora-linkchecker-primary labels: helm.sh/chart: sophora-linkchecker-0.9.8 app.kubernetes.io/name: sophora-linkchecker @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-linkchecker-secondary + labels: + helm.sh/chart: sophora-linkchecker-0.9.8 + app.kubernetes.io/name: sophora-linkchecker + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-linkchecker + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-linkchecker/tests/values/httproute.yaml b/charts/sophora-linkchecker/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-linkchecker/tests/values/httproute.yaml +++ b/charts/sophora-linkchecker/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-media-finder/tests/httproute_test.yaml b/charts/sophora-media-finder/tests/httproute_test.yaml index 6e8c9b3e..c3d4db1e 100644 --- a/charts/sophora-media-finder/tests/httproute_test.yaml +++ b/charts/sophora-media-finder/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-media-finder - - equal: + name: values-test-release-sophora-media-finder-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-media-finder-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-media-finder + name: values-test-release-sophora-media-finder-primary labels: helm.sh/chart: sophora-media-finder-0.9.8 app.kubernetes.io/name: sophora-media-finder @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-media-finder-secondary + labels: + helm.sh/chart: sophora-media-finder-0.9.8 + app.kubernetes.io/name: sophora-media-finder + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-media-finder + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-media-finder/tests/values/httproute.yaml b/charts/sophora-media-finder/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-media-finder/tests/values/httproute.yaml +++ b/charts/sophora-media-finder/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-metadata-supplier/tests/httproute_test.yaml b/charts/sophora-metadata-supplier/tests/httproute_test.yaml index 84637fe7..fd239376 100644 --- a/charts/sophora-metadata-supplier/tests/httproute_test.yaml +++ b/charts/sophora-metadata-supplier/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-metadata-supplier - - equal: + name: values-test-release-sophora-metadata-supplier-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-metadata-supplier-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-metadata-supplier + name: values-test-release-sophora-metadata-supplier-primary labels: helm.sh/chart: sophora-metadata-supplier-0.9.8 app.kubernetes.io/name: sophora-metadata-supplier @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-metadata-supplier-secondary + labels: + helm.sh/chart: sophora-metadata-supplier-0.9.8 + app.kubernetes.io/name: sophora-metadata-supplier + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-metadata-supplier + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-metadata-supplier/tests/values/httproute.yaml b/charts/sophora-metadata-supplier/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-metadata-supplier/tests/values/httproute.yaml +++ b/charts/sophora-metadata-supplier/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-schema-docs/tests/httproute_test.yaml b/charts/sophora-schema-docs/tests/httproute_test.yaml index f7c48446..5a7a7363 100644 --- a/charts/sophora-schema-docs/tests/httproute_test.yaml +++ b/charts/sophora-schema-docs/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-schema-docs - - equal: + name: values-test-release-sophora-schema-docs-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-schema-docs-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-schema-docs + name: values-test-release-sophora-schema-docs-primary labels: helm.sh/chart: sophora-schema-docs-0.9.8 app.kubernetes.io/name: sophora-schema-docs @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-schema-docs-secondary + labels: + helm.sh/chart: sophora-schema-docs-0.9.8 + app.kubernetes.io/name: sophora-schema-docs + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-schema-docs + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-schema-docs/tests/values/httproute.yaml b/charts/sophora-schema-docs/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-schema-docs/tests/values/httproute.yaml +++ b/charts/sophora-schema-docs/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-server/templates/httproute.yaml b/charts/sophora-server/templates/httproute.yaml index 15b5acf2..8f2c25c3 100644 --- a/charts/sophora-server/templates/httproute.yaml +++ b/charts/sophora-server/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "sophora-server.fullname" . -}} {{- $labels := include "sophora-server.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.sophora.server.ports.http -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/sophora-server/tests/httproute_test.yaml b/charts/sophora-server/tests/httproute_test.yaml index 2ceb5a99..4bb61625 100644 --- a/charts/sophora-server/tests/httproute_test.yaml +++ b/charts/sophora-server/tests/httproute_test.yaml @@ -3,38 +3,48 @@ templates: - httproute.yaml chart: version: 0.9.8 +set: + image.tag: 1.2.3 tests: - it: should not create httproute by default asserts: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-server - - equal: + name: values-test-release-sophora-server-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-server-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-server + name: values-test-release-sophora-server-primary labels: helm.sh/chart: sophora-server-0.9.8 app.kubernetes.io/name: sophora-server - app.kubernetes.io/version: latest + app.kubernetes.io/version: 1.2.3 app.kubernetes.io/instance: values-test-release app.kubernetes.io/managed-by: Helm annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -57,4 +67,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-server-secondary + labels: + helm.sh/chart: sophora-server-0.9.8 + app.kubernetes.io/name: sophora-server + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-server + port: 1196 - notFailedTemplate: {} diff --git a/charts/sophora-server/tests/values/httproute.yaml b/charts/sophora-server/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-server/tests/values/httproute.yaml +++ b/charts/sophora-server/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-ugc/templates/httproute.yaml b/charts/sophora-ugc/templates/httproute.yaml index 31ebae85..8bc5f76f 100644 --- a/charts/sophora-ugc/templates/httproute.yaml +++ b/charts/sophora-ugc/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "sophora-ugc.fullname" . -}} {{- $labels := include "sophora-ugc.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := default 8080 ($.Values.ugc.config.server).port -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/sophora-ugc/tests/httproute_test.yaml b/charts/sophora-ugc/tests/httproute_test.yaml index 3c22ea24..010388d5 100644 --- a/charts/sophora-ugc/tests/httproute_test.yaml +++ b/charts/sophora-ugc/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-ugc - - equal: + name: values-test-release-sophora-ugc-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-ugc-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-ugc + name: values-test-release-sophora-ugc-primary labels: helm.sh/chart: sophora-ugc-0.9.8 app.kubernetes.io/name: sophora-ugc @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-ugc-secondary + labels: + helm.sh/chart: sophora-ugc-0.9.8 + app.kubernetes.io/name: sophora-ugc + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-ugc + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-ugc/tests/values/httproute.yaml b/charts/sophora-ugc/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-ugc/tests/values/httproute.yaml +++ b/charts/sophora-ugc/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-webclient/tests/httproute_test.yaml b/charts/sophora-webclient/tests/httproute_test.yaml index 82734e69..f0642030 100644 --- a/charts/sophora-webclient/tests/httproute_test.yaml +++ b/charts/sophora-webclient/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-webclient - - equal: + name: values-test-release-sophora-webclient-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-webclient-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-webclient + name: values-test-release-sophora-webclient-primary labels: helm.sh/chart: sophora-webclient-0.9.8 app.kubernetes.io/name: sophora-webclient @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-webclient-secondary + labels: + helm.sh/chart: sophora-webclient-0.9.8 + app.kubernetes.io/name: sophora-webclient + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-webclient + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-webclient/tests/values/httproute.yaml b/charts/sophora-webclient/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-webclient/tests/values/httproute.yaml +++ b/charts/sophora-webclient/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file diff --git a/charts/sophora-youtube-connector/templates/httproute.yaml b/charts/sophora-youtube-connector/templates/httproute.yaml index f0adcde0..72cc2842 100644 --- a/charts/sophora-youtube-connector/templates/httproute.yaml +++ b/charts/sophora-youtube-connector/templates/httproute.yaml @@ -1,6 +1,6 @@ {{- $fullName := include "sophora-youtube-connector.fullname" . -}} {{- $labels := include "sophora-youtube-connector.labels" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.service.httpPort -}} {{- range $key, $httpRoute := .Values.httpRoutes }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute diff --git a/charts/sophora-youtube-connector/tests/httproute_test.yaml b/charts/sophora-youtube-connector/tests/httproute_test.yaml index 5939ef3d..a4de605f 100644 --- a/charts/sophora-youtube-connector/tests/httproute_test.yaml +++ b/charts/sophora-youtube-connector/tests/httproute_test.yaml @@ -10,22 +10,29 @@ tests: - hasDocuments: count: 0 - - it: should create httproute with values + - it: should create multiple httproutes with values release: name: values-test-release values: - ./values/httproute.yaml asserts: - hasDocuments: - count: 1 - - containsDocument: + count: 2 + - documentIndex: 0 + containsDocument: kind: HTTPRoute apiVersion: gateway.networking.k8s.io/v1 - name: values-test-release-sophora-youtube-connector - - equal: + name: values-test-release-sophora-youtube-connector-primary + - documentIndex: 1 + containsDocument: + kind: HTTPRoute + apiVersion: gateway.networking.k8s.io/v1 + name: values-test-release-sophora-youtube-connector-secondary + - documentIndex: 0 + equal: path: metadata value: - name: values-test-release-sophora-youtube-connector + name: values-test-release-sophora-youtube-connector-primary labels: helm.sh/chart: sophora-youtube-connector-0.9.8 app.kubernetes.io/name: sophora-youtube-connector @@ -35,7 +42,8 @@ tests: annotations: example.com/test: "simple" example.com/text: some text value - - equal: + - documentIndex: 0 + equal: path: spec value: parentRefs: @@ -58,4 +66,28 @@ tests: - path: type: PathPrefix value: / + - documentIndex: 1 + equal: + path: metadata + value: + name: values-test-release-sophora-youtube-connector-secondary + labels: + helm.sh/chart: sophora-youtube-connector-0.9.8 + app.kubernetes.io/name: sophora-youtube-connector + app.kubernetes.io/version: 1.2.3 + app.kubernetes.io/instance: values-test-release + app.kubernetes.io/managed-by: Helm + - documentIndex: 1 + equal: + path: spec + value: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com + rules: + - backendRefs: + - name: values-test-release-sophora-youtube-connector + port: 8080 - notFailedTemplate: {} diff --git a/charts/sophora-youtube-connector/tests/values/httproute.yaml b/charts/sophora-youtube-connector/tests/values/httproute.yaml index fa51e6cc..ee550638 100644 --- a/charts/sophora-youtube-connector/tests/values/httproute.yaml +++ b/charts/sophora-youtube-connector/tests/values/httproute.yaml @@ -1,21 +1,27 @@ -httpRoute: - enabled: true - parentRefs: - - name: my-gateway - namespace: gateway-namespace - hostnames: - - my-service.example.com - - other.example.com - matches: - - path: - type: PathPrefix - value: / - filters: - - type: RequestHeaderModifier - requestHeaderModifier: - set: - - name: X-Custom-Header - value: custom-value - annotations: - example.com/test: simple - example.com/text: some text value +httpRoutes: + primary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - my-service.example.com + - other.example.com + matches: + - path: + type: PathPrefix + value: / + filters: + - type: RequestHeaderModifier + requestHeaderModifier: + set: + - name: X-Custom-Header + value: custom-value + annotations: + example.com/test: simple + example.com/text: some text value + secondary: + parentRefs: + - name: my-gateway + namespace: gateway-namespace + hostnames: + - second.example.com \ No newline at end of file From 0daaf7e6897d0e632bdaedf2a6e00fe600383f04 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Jun 2026 09:10:05 +0000 Subject: [PATCH 09/14] fix: sort httpRoutes iteration and truncate name to 63 chars in sophora-youtube-connector --- charts/sophora-youtube-connector/templates/httproute.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/sophora-youtube-connector/templates/httproute.yaml b/charts/sophora-youtube-connector/templates/httproute.yaml index 72cc2842..a852f6d5 100644 --- a/charts/sophora-youtube-connector/templates/httproute.yaml +++ b/charts/sophora-youtube-connector/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-youtube-connector.fullname" . -}} {{- $labels := include "sophora-youtube-connector.labels" . -}} {{- $svcPort := .Values.service.httpPort -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} From 54ddbddee0d32db3018ef6b1c794a2691bd379e0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Jun 2026 09:15:04 +0000 Subject: [PATCH 10/14] fix: extract httpRouteName helper function in sophora-youtube-connector --- charts/sophora-youtube-connector/templates/_helpers.tpl | 7 +++++++ charts/sophora-youtube-connector/templates/httproute.yaml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/sophora-youtube-connector/templates/_helpers.tpl b/charts/sophora-youtube-connector/templates/_helpers.tpl index 21c32dca..a5f0b0e6 100644 --- a/charts/sophora-youtube-connector/templates/_helpers.tpl +++ b/charts/sophora-youtube-connector/templates/_helpers.tpl @@ -50,6 +50,13 @@ app.kubernetes.io/name: {{ include "sophora-youtube-connector.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Create the name of an HTTPRoute resource by combining the fullname and the route key, truncated to 63 chars. +*/}} +{{- define "sophora-youtube-connector.httpRouteName" -}} +{{- printf "%s-%s" (include "sophora-youtube-connector.fullname" .root) .key | trunc 63 | trimSuffix "-" }} +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/charts/sophora-youtube-connector/templates/httproute.yaml b/charts/sophora-youtube-connector/templates/httproute.yaml index a852f6d5..ceaf73f8 100644 --- a/charts/sophora-youtube-connector/templates/httproute.yaml +++ b/charts/sophora-youtube-connector/templates/httproute.yaml @@ -6,7 +6,7 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} + name: {{ include "sophora-youtube-connector.httpRouteName" (dict "root" $ "key" $key) }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} From 1aa3448956ce9713380420ba37449d7057398c0e Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Wed, 3 Jun 2026 11:17:45 +0200 Subject: [PATCH 11/14] Revert "fix: extract httpRouteName helper function in sophora-youtube-connector" This reverts commit 54ddbddee0d32db3018ef6b1c794a2691bd379e0. --- charts/sophora-youtube-connector/templates/_helpers.tpl | 7 ------- charts/sophora-youtube-connector/templates/httproute.yaml | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/charts/sophora-youtube-connector/templates/_helpers.tpl b/charts/sophora-youtube-connector/templates/_helpers.tpl index a5f0b0e6..21c32dca 100644 --- a/charts/sophora-youtube-connector/templates/_helpers.tpl +++ b/charts/sophora-youtube-connector/templates/_helpers.tpl @@ -50,13 +50,6 @@ app.kubernetes.io/name: {{ include "sophora-youtube-connector.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Create the name of an HTTPRoute resource by combining the fullname and the route key, truncated to 63 chars. -*/}} -{{- define "sophora-youtube-connector.httpRouteName" -}} -{{- printf "%s-%s" (include "sophora-youtube-connector.fullname" .root) .key | trunc 63 | trimSuffix "-" }} -{{- end }} - {{/* Create the name of the service account to use */}} diff --git a/charts/sophora-youtube-connector/templates/httproute.yaml b/charts/sophora-youtube-connector/templates/httproute.yaml index ceaf73f8..a852f6d5 100644 --- a/charts/sophora-youtube-connector/templates/httproute.yaml +++ b/charts/sophora-youtube-connector/templates/httproute.yaml @@ -6,7 +6,7 @@ apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ include "sophora-youtube-connector.httpRouteName" (dict "root" $ "key" $key) }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} From 1a8ef7d1fd21dd03187a9592b508eda36225ff27 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Wed, 3 Jun 2026 11:26:07 +0200 Subject: [PATCH 12/14] fix: sort httpRoutes iteration and truncate name to 63 chars in all httproute.yaml --- charts/o-neko-catnip/templates/httproute.yaml | 5 +++-- charts/o-neko/templates/httproute.yaml | 5 +++-- charts/planr-tools/templates/httproute.yaml | 5 +++-- charts/sophora-admin-dashboard/templates/httproute.yaml | 5 +++-- charts/sophora-ai/templates/httproute.yaml | 5 +++-- charts/sophora-contentapi/templates/httproute.yaml | 5 +++-- charts/sophora-image-access-service/templates/httproute.yaml | 5 +++-- charts/sophora-image-ai/templates/httproute.yaml | 5 +++-- charts/sophora-importer/templates/httproute.yaml | 5 +++-- charts/sophora-indexing-service/templates/httproute.yaml | 5 +++-- charts/sophora-linkchecker/templates/httproute.yaml | 5 +++-- charts/sophora-media-finder/templates/httproute.yaml | 5 +++-- charts/sophora-metadata-supplier/templates/httproute.yaml | 5 +++-- charts/sophora-schema-docs/templates/httproute.yaml | 5 +++-- charts/sophora-seo-check/templates/httproute.yaml | 5 +++-- charts/sophora-server/templates/httproute.yaml | 5 +++-- charts/sophora-ugc/templates/httproute.yaml | 5 +++-- charts/sophora-webclient/templates/httproute.yaml | 5 +++-- 18 files changed, 54 insertions(+), 36 deletions(-) diff --git a/charts/o-neko-catnip/templates/httproute.yaml b/charts/o-neko-catnip/templates/httproute.yaml index 076975aa..20692fde 100644 --- a/charts/o-neko-catnip/templates/httproute.yaml +++ b/charts/o-neko-catnip/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "o-neko-catnip.fullname" . -}} {{- $labels := include "o-neko-catnip.labels" . -}} {{- $svcPort := 8080 -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/o-neko/templates/httproute.yaml b/charts/o-neko/templates/httproute.yaml index c2a797b6..2aeffff5 100644 --- a/charts/o-neko/templates/httproute.yaml +++ b/charts/o-neko/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "o-neko.fullname" . -}} {{- $labels := include "o-neko.labels" . -}} {{- $svcPort := 8080 -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/planr-tools/templates/httproute.yaml b/charts/planr-tools/templates/httproute.yaml index a1c0450c..0c81c04b 100644 --- a/charts/planr-tools/templates/httproute.yaml +++ b/charts/planr-tools/templates/httproute.yaml @@ -1,10 +1,11 @@ {{- $fullName := include "planr-tools.fullname" . }} {{- $labels := include "planr-tools.labels" (dict "root" . "component" (dict "name" "gateway")) -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-admin-dashboard/templates/httproute.yaml b/charts/sophora-admin-dashboard/templates/httproute.yaml index a988ebc4..a7747ad3 100644 --- a/charts/sophora-admin-dashboard/templates/httproute.yaml +++ b/charts/sophora-admin-dashboard/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-admin-dashboard.fullname" . -}} {{- $labels := include "sophora-admin-dashboard.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-ai/templates/httproute.yaml b/charts/sophora-ai/templates/httproute.yaml index e184b005..00e259db 100644 --- a/charts/sophora-ai/templates/httproute.yaml +++ b/charts/sophora-ai/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-ai.fullname" . -}} {{- $labels := include "sophora-ai.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-contentapi/templates/httproute.yaml b/charts/sophora-contentapi/templates/httproute.yaml index 134d7cc7..d86e3972 100644 --- a/charts/sophora-contentapi/templates/httproute.yaml +++ b/charts/sophora-contentapi/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-contentapi.fullname" . -}} {{- $labels := include "sophora-contentapi.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-image-access-service/templates/httproute.yaml b/charts/sophora-image-access-service/templates/httproute.yaml index eadf5283..74c91df5 100644 --- a/charts/sophora-image-access-service/templates/httproute.yaml +++ b/charts/sophora-image-access-service/templates/httproute.yaml @@ -1,11 +1,12 @@ {{ $fullName := include "access-service.fullname" $ -}} {{- $labels := include "access-service.labels" . -}} {{- $svcPort := .Values.service.httpPort -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-image-ai/templates/httproute.yaml b/charts/sophora-image-ai/templates/httproute.yaml index 78bedb58..8ce1844e 100644 --- a/charts/sophora-image-ai/templates/httproute.yaml +++ b/charts/sophora-image-ai/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-image-ai.fullname" . -}} {{- $labels := include "sophora-image-ai.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-importer/templates/httproute.yaml b/charts/sophora-importer/templates/httproute.yaml index 82404476..f4dd37cf 100644 --- a/charts/sophora-importer/templates/httproute.yaml +++ b/charts/sophora-importer/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-importer.fullname" . -}} {{- $labels := include "sophora-importer.labels" . -}} {{- $svcPort := .Values.service.httpPort -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-indexing-service/templates/httproute.yaml b/charts/sophora-indexing-service/templates/httproute.yaml index f30ab566..f005c9da 100644 --- a/charts/sophora-indexing-service/templates/httproute.yaml +++ b/charts/sophora-indexing-service/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-indexing-service.fullname" . -}} {{- $labels := include "sophora-indexing-service.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-linkchecker/templates/httproute.yaml b/charts/sophora-linkchecker/templates/httproute.yaml index 5b70586c..ce18fce1 100644 --- a/charts/sophora-linkchecker/templates/httproute.yaml +++ b/charts/sophora-linkchecker/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-linkchecker.fullname" . -}} {{- $labels := include "sophora-linkchecker.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-media-finder/templates/httproute.yaml b/charts/sophora-media-finder/templates/httproute.yaml index 9384f9d3..f45f83ad 100644 --- a/charts/sophora-media-finder/templates/httproute.yaml +++ b/charts/sophora-media-finder/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-media-finder.fullname" . -}} {{- $labels := include "sophora-media-finder.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-metadata-supplier/templates/httproute.yaml b/charts/sophora-metadata-supplier/templates/httproute.yaml index fbbdd16a..b5507aa8 100644 --- a/charts/sophora-metadata-supplier/templates/httproute.yaml +++ b/charts/sophora-metadata-supplier/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-metadata-supplier.fullname" . -}} {{- $labels := include "sophora-metadata-supplier.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-schema-docs/templates/httproute.yaml b/charts/sophora-schema-docs/templates/httproute.yaml index 18f2b5db..fa8f9586 100644 --- a/charts/sophora-schema-docs/templates/httproute.yaml +++ b/charts/sophora-schema-docs/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-schema-docs.fullname" . -}} {{- $labels := include "sophora-schema-docs.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-seo-check/templates/httproute.yaml b/charts/sophora-seo-check/templates/httproute.yaml index 90bbb8d4..00a45484 100644 --- a/charts/sophora-seo-check/templates/httproute.yaml +++ b/charts/sophora-seo-check/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-seo-check.fullname" . -}} {{- $labels := include "sophora-seo-check.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-server/templates/httproute.yaml b/charts/sophora-server/templates/httproute.yaml index 8f2c25c3..60de7632 100644 --- a/charts/sophora-server/templates/httproute.yaml +++ b/charts/sophora-server/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-server.fullname" . -}} {{- $labels := include "sophora-server.labels" . -}} {{- $svcPort := .Values.sophora.server.ports.http -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-ugc/templates/httproute.yaml b/charts/sophora-ugc/templates/httproute.yaml index 8bc5f76f..f633f4d9 100644 --- a/charts/sophora-ugc/templates/httproute.yaml +++ b/charts/sophora-ugc/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "sophora-ugc.fullname" . -}} {{- $labels := include "sophora-ugc.labels" . -}} {{- $svcPort := default 8080 ($.Values.ugc.config.server).port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} diff --git a/charts/sophora-webclient/templates/httproute.yaml b/charts/sophora-webclient/templates/httproute.yaml index 39a7f0a4..ed201304 100644 --- a/charts/sophora-webclient/templates/httproute.yaml +++ b/charts/sophora-webclient/templates/httproute.yaml @@ -1,11 +1,12 @@ {{- $fullName := include "webclient.fullname" . -}} {{- $labels := include "webclient.labels" . -}} {{- $svcPort := .Values.service.port -}} -{{- range $key, $httpRoute := .Values.httpRoutes }} +{{- range $key := (.Values.httpRoutes | keys | sortAlpha) }} +{{- $httpRoute := index $.Values.httpRoutes $key }} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: - name: {{ $fullName }}-{{ $key }} + name: {{ printf "%s-%s" $fullName $key | trunc 63 | trimSuffix "-" }} labels: {{- $labels | nindent 4 }} {{- with $httpRoute.annotations }} From 26e5b18f77bda9c0b8dfab2c06e0434e292a94c0 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Wed, 3 Jun 2026 11:31:58 +0200 Subject: [PATCH 13/14] [planr-tools] don't set `filters: null` --- charts/planr-tools/tests/httproute_test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/planr-tools/tests/httproute_test.yaml b/charts/planr-tools/tests/httproute_test.yaml index 0c504c80..8ed1d583 100644 --- a/charts/planr-tools/tests/httproute_test.yaml +++ b/charts/planr-tools/tests/httproute_test.yaml @@ -154,7 +154,6 @@ tests: - backendRefs: - name: values-test-release-planr-tools-newsroom-widget port: 8082 - filters: null matches: - path: type: PathPrefix From cec1ab426dd432d19f88a8326001c751d9713066 Mon Sep 17 00:00:00 2001 From: Daniel Raap Date: Fri, 12 Jun 2026 09:37:59 +0200 Subject: [PATCH 14/14] [planr-tools] don't set `filters: null` actually --- charts/planr-tools/templates/httproute.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/planr-tools/templates/httproute.yaml b/charts/planr-tools/templates/httproute.yaml index 0c81c04b..79945e2a 100644 --- a/charts/planr-tools/templates/httproute.yaml +++ b/charts/planr-tools/templates/httproute.yaml @@ -34,6 +34,7 @@ spec: - path: type: PathPrefix value: {{ $component.exposure.path | quote }} + {{- if or (ne $component.exposure.path "/") $httpRoute.filters }} filters: {{- if ne $component.exposure.path "/" }} {{/* Strip the path prefix so apps receive requests at their own root, same as the Ingress rewrite. */}} @@ -46,6 +47,7 @@ spec: {{- with $httpRoute.filters }} {{- toYaml . | nindent 8 }} {{- end }} + {{- end }} {{- end }} {{- end }} ---