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: []