From 989cc07956100a32f86ed385559f2f73aaf17ffb Mon Sep 17 00:00:00 2001 From: Oliver Meyer Date: Wed, 22 Apr 2026 08:36:09 +0200 Subject: [PATCH] support HTTPRoute and ListenerSet Signed-off-by: Oliver Meyer --- zammad/templates/httpRoute.yaml | 48 +++++++++++++++++++++++++++++++ zammad/templates/listenerSet.yaml | 28 ++++++++++++++++++ zammad/values.yaml | 44 ++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 zammad/templates/httpRoute.yaml create mode 100644 zammad/templates/listenerSet.yaml diff --git a/zammad/templates/httpRoute.yaml b/zammad/templates/httpRoute.yaml new file mode 100644 index 00000000..4914dc3b --- /dev/null +++ b/zammad/templates/httpRoute.yaml @@ -0,0 +1,48 @@ +{{- if .Values.httpRoute.enabled -}} +{{- $fullName := include "zammad.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zammad.labels" . | nindent 4 }} + {{- with .Values.httpRoute.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- include "zammad.annotations" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- if .Values.listenerSet.enabled }} + - kind: ListenerSet + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + {{- end }} + {{- with .Values.httpRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.httpRoute.rules }} + {{- with .matches }} + - matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ $fullName}}-nginx + port: {{ $svcPort }} + weight: 1 + {{- end }} +{{- end }} diff --git a/zammad/templates/listenerSet.yaml b/zammad/templates/listenerSet.yaml new file mode 100644 index 00000000..3250aa30 --- /dev/null +++ b/zammad/templates/listenerSet.yaml @@ -0,0 +1,28 @@ +{{- if .Values.listenerSet.enabled -}} +{{- $fullName := include "zammad.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: ListenerSet +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "zammad.labels" . | nindent 4 }} + {{- with .Values.listenerSet.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- include "zammad.annotations" . | nindent 4 }} + {{- with .Values.listenerSet.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRef: + {{- with .Values.listenerSet.parentRef }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.listenerSet.listeners }} + listeners: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/zammad/values.yaml b/zammad/values.yaml index 678a0605..46336e56 100755 --- a/zammad/values.yaml +++ b/zammad/values.yaml @@ -35,6 +35,50 @@ ingress: # - chart-example.local labels: {} +# -- Expose the service via gateway-api HTTPRoute +# Requires Gateway API resources and suitable controller installed within the cluster +# (see: https://gateway-api.sigs.k8s.io/guides/) +httpRoute: + enabled: false + annotations: {} + parentRefs: + # When .Values.listenerSet.enabled is true, the listenerSet is used as the parent + # - name: gateway + # sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - chart-example.local + # List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: / + +# -- Expose the service via gateway-api ListenerSet +# Requires Gateway API resources and suitable controller installed within the cluster +# (see: https://gateway-api.sigs.k8s.io/guides/) +listenerSet: + enabled: false + annotations: {} + parentRef: + # name: gateway + # namespace: default + # Hostnames matching HTTP header. + listeners: + - name: http + hostname: chart-example.local + port: 80 + protocol: HTTP + # - name: https + # hostname: chart-example.local + # port: 443 + # protocol: HTTPS + # tls: + # mode: Terminate + # certificateRefs: + # - name: chart-example-tls # Please note that passwords for PostgreSQL, Redis and S3 may not # contain special characters which would require URL encoding.