From 32f032e5141b2cb7d097bb5f9345e5b94872ff2a Mon Sep 17 00:00:00 2001 From: Miguel Horcajada Date: Fri, 24 Apr 2026 10:42:01 +0200 Subject: [PATCH] feat(capacitor-next): add Gateway API HTTPRoute support Add native HTTPRoute support to the capacitor-next Helm chart. Changes: - add templates/httproute.yaml - add httpRoute configuration block to values.yaml - support configurable apiVersion and kind - support parentRefs, hostnames, annotations, and matches - default to PathPrefix / when no matches are provided Validated with: - helm lint - helm template - real deployment in cluster using Cilium Gateway API - successful routing through Gateway + HTTPRoute to capacitor-next --- .../capacitor-next/templates/httproute.yaml | 36 +++++++++++++++++++ self-host/charts/capacitor-next/values.yaml | 17 +++++++++ 2 files changed, 53 insertions(+) create mode 100644 self-host/charts/capacitor-next/templates/httproute.yaml diff --git a/self-host/charts/capacitor-next/templates/httproute.yaml b/self-host/charts/capacitor-next/templates/httproute.yaml new file mode 100644 index 00000000..cc4af521 --- /dev/null +++ b/self-host/charts/capacitor-next/templates/httproute.yaml @@ -0,0 +1,36 @@ +{{- if .Values.httpRoute.enabled -}} +apiVersion: {{ .Values.httpRoute.apiVersion | default "gateway.networking.k8s.io/v1" }} +kind: {{ .Values.httpRoute.kind | default "HTTPRoute" }} +metadata: + name: {{ include "capacitor-server.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "capacitor-server.labels" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.httpRoute.parentRefs }} + parentRefs: + {{- toYaml .Values.httpRoute.parentRefs | nindent 4 }} + {{- end }} + {{- if .Values.httpRoute.hostnames }} + hostnames: + {{- range .Values.httpRoute.hostnames }} + - {{ tpl . $ | quote }} + {{- end }} + {{- end }} + rules: + - matches: + {{- if .Values.httpRoute.matches }} + {{- toYaml .Values.httpRoute.matches | nindent 8 }} + {{- else }} + - path: + type: PathPrefix + value: / + {{- end }} + backendRefs: + - name: {{ include "capacitor-server.fullname" . }} + port: {{ .Values.service.port }} +{{- end }} diff --git a/self-host/charts/capacitor-next/values.yaml b/self-host/charts/capacitor-next/values.yaml index 46f85532..5b516663 100644 --- a/self-host/charts/capacitor-next/values.yaml +++ b/self-host/charts/capacitor-next/values.yaml @@ -176,6 +176,23 @@ ingress: # hosts: # - capacitor.example.com +## HTTPRoute configuration +httpRoute: + # -- Enables Gateway API HTTPRoute resource generation instead of standard Ingress + enabled: false + # -- HTTPRoute apiVersion. Keep this configurable for environments that need a non-default Gateway API version + apiVersion: gateway.networking.k8s.io/v1 + # -- HTTPRoute kind + kind: HTTPRoute + # -- Key-value map for controller-specific metadata + annotations: {} + # -- FQDNs for Layer 7 hostname matching. If empty, the route matches all hostnames allowed by the parent Gateway listener + hostnames: [] + # -- References to the parent Gateway listeners this route should attach to + parentRefs: [] + # -- Match rules applied before the default PathPrefix "/" fallback + matches: [] + nodeSelector: {} tolerations: []