From 15e6d4dbd0bcdee4a588c75b955fc0aded0d6fdf Mon Sep 17 00:00:00 2001 From: Jasper Weyne Date: Wed, 14 Jan 2026 10:54:37 +0100 Subject: [PATCH] feat: add support for existing gateways in helm chart (#1469) Co-authored-by: loverustfs --- helm/README.md | 2 ++ helm/rustfs/templates/gateway-api/gateway.yml | 2 +- helm/rustfs/templates/gateway-api/httproute.yml | 7 +++++++ helm/rustfs/templates/secret-tls.yaml | 2 +- helm/rustfs/values.yaml | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/helm/README.md b/helm/README.md index 2d635767..1ace7039 100644 --- a/helm/README.md +++ b/helm/README.md @@ -114,6 +114,8 @@ RustFS helm chart supports **standalone and distributed mode**. For standalone m | gatewayApi.gatewayClass | string | `traefik` | Gateway class implementation. | | 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. | +| gatewayApi.existingGateway.namespace | string | `""` | The namespace of the existing gateway, if not the local namespace. | --- diff --git a/helm/rustfs/templates/gateway-api/gateway.yml b/helm/rustfs/templates/gateway-api/gateway.yml index 8b50f5ae..fde30aa1 100644 --- a/helm/rustfs/templates/gateway-api/gateway.yml +++ b/helm/rustfs/templates/gateway-api/gateway.yml @@ -1,4 +1,4 @@ -{{- if .Values.gatewayApi.enabled }} +{{- if and .Values.gatewayApi.enabled (empty .Values.gatewayApi.existingGateway.name) }} apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: diff --git a/helm/rustfs/templates/gateway-api/httproute.yml b/helm/rustfs/templates/gateway-api/httproute.yml index 9ac5d968..edd0b517 100644 --- a/helm/rustfs/templates/gateway-api/httproute.yml +++ b/helm/rustfs/templates/gateway-api/httproute.yml @@ -5,7 +5,14 @@ metadata: name: {{ include "rustfs.fullname" . }}-route spec: parentRefs: + {{- if .Values.gatewayApi.existingGateway.name }} + - name: {{ .Values.gatewayApi.existingGateway.name }} + {{- if .Values.gatewayApi.existingGateway.namespace }} + namespace: {{ .Values.gatewayApi.existingGateway.namespace }} + {{- end }} + {{- else }} - name: {{ include "rustfs.fullname" . }}-gateway + {{- end }} hostnames: - {{ .Values.gatewayApi.hostname }} rules: diff --git a/helm/rustfs/templates/secret-tls.yaml b/helm/rustfs/templates/secret-tls.yaml index fea2cf58..730f5766 100644 --- a/helm/rustfs/templates/secret-tls.yaml +++ b/helm/rustfs/templates/secret-tls.yaml @@ -1,4 +1,4 @@ -{{- if and (or .Values.gatewayApi.enabled .Values.ingress.tls.enabled) (not .Values.ingress.tls.certManager.enabled) }} +{{- if and (or .Values.gatewayApi.enabled .Values.ingress.tls.enabled) (not (or .Values.ingress.tls.certManager.enabled .Values.gatewayApi.existingGateway.name)) }} apiVersion: v1 kind: Secret metadata: diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index d8017cc0..eb772251 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -140,6 +140,9 @@ gatewayApi: gatewayClass: traefik hostname: example.rustfs.com secretName: secret-tls + existingGateway: + name: "" + namespace: "" resources: # We usually recommend not to specify default resources and to leave this as a conscious