From da15d622a0e084a5d3ad58079e8401aabe3f763b Mon Sep 17 00:00:00 2001 From: majinghe <42570491+majinghe@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:01:40 +0800 Subject: [PATCH] fix: gateway api listener name hardcode issue (#1834) Co-authored-by: houseme --- helm/README.md | 4 ++++ helm/rustfs/templates/gateway-api/gateway.yml | 12 +++++------ .../templates/gateway-api/httproute.yml | 20 +++++++++---------- helm/rustfs/values.yaml | 6 ++++-- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/helm/README.md b/helm/README.md index 7ff22e878..3232d1723 100644 --- a/helm/README.md +++ b/helm/README.md @@ -119,6 +119,10 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | tolerations | list | `[]` | | | gatewayApi.enabled | bool | `false` | To enable/disable gateway api support. | | gatewayApi.gatewayClass | string | `traefik` | Gateway class implementation. | +| gatewayApi.listeners.http.name | string | `web` | Gateway API http listener name. | +| gatewayApi.listeners.http.port| int | `8000` | Gateway API http listener port. | +| gatewayApi.listeners.https.name | string | `websecure` | Gateway API https listener name. | +| gatewayApi.listeners.https.port| int | `8443` | Gateway API https listener port. | | gatewayApi.hostname | string | Hostname to access RustFS via gateway api. | | gatewayApi.secretName | string | Secret tls to via RustFS using HTTPS. | | gatewayApi.existingGateway.name | string | `""` | The existing gateway name, instead of creating a new one. | diff --git a/helm/rustfs/templates/gateway-api/gateway.yml b/helm/rustfs/templates/gateway-api/gateway.yml index dd5e46d69..207637b3e 100644 --- a/helm/rustfs/templates/gateway-api/gateway.yml +++ b/helm/rustfs/templates/gateway-api/gateway.yml @@ -8,17 +8,17 @@ spec: gatewayClassName: {{ .Values.gatewayApi.gatewayClass }} {{- with .Values.gatewayApi.listeners }} listeners: - {{- if .web }} - - name: http - port: {{ .web.port }} + {{- if .http }} + - name: {{ .http.name }} + port: {{ .http.port }} protocol: HTTP allowedRoutes: namespaces: from: Same {{- end }} - {{- if .websecure }} - - name: https - port: {{ .websecure.port }} + {{- if .https }} + - name: {{ .https.name }} + port: {{ .https.port }} protocol: HTTPS tls: mode: Terminate diff --git a/helm/rustfs/templates/gateway-api/httproute.yml b/helm/rustfs/templates/gateway-api/httproute.yml index dc48f32fc..78a1430d0 100644 --- a/helm/rustfs/templates/gateway-api/httproute.yml +++ b/helm/rustfs/templates/gateway-api/httproute.yml @@ -10,16 +10,16 @@ metadata: {{- end }} spec: parentRefs: - {{- if .Values.gatewayApi.existingGateway.name }} + {{- if .Values.gatewayApi.existingGateway.name }} - name: {{ .Values.gatewayApi.existingGateway.name }} {{- if .Values.gatewayApi.existingGateway.namespace }} namespace: {{ .Values.gatewayApi.existingGateway.namespace }} {{- end }} - sectionName: https - {{- else }} + sectionName: {{ .Values.gatewayApi.listeners.https.name | default "websecure"}} + {{- else }} - name: {{ include "rustfs.fullname" $ }}-gateway - sectionName: https - {{- end }} + sectionName: {{ .Values.gatewayApi.listeners.https.name | default "websecure"}} + {{- end }} hostnames: - {{ .Values.gatewayApi.hostname }} rules: @@ -46,16 +46,16 @@ metadata: namespace: {{ .Release.Namespace }} spec: parentRefs: - {{- if .Values.gatewayApi.existingGateway.name }} + {{- if .Values.gatewayApi.existingGateway.name }} - name: {{ .Values.gatewayApi.existingGateway.name }} {{- if .Values.gatewayApi.existingGateway.namespace }} namespace: {{ .Values.gatewayApi.existingGateway.namespace }} {{- end }} - sectionName: http - {{- else }} + sectionName: {{ .Values.gatewayApi.listeners.http.name | default "web" }} + {{- else }} - name: {{ include "rustfs.fullname" $ }}-gateway - sectionName: http - {{- end }} + sectionName: {{ .Values.gatewayApi.listeners.http.name | default "web" }} + {{- end }} rules: - filters: - type: RequestRedirect diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index 701fc039d..d7993595e 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -154,9 +154,11 @@ gatewayApi: enabled: false gatewayClass: traefik listeners: # Specify which listeners to create on the Gateway. Only support for traefik gatewayClass at the moment. - web: + http: + name: web port: 8000 - websecure: + https: + name: websecure port: 8443 hostname: example.rustfs.com existingGateway: