From 11e97951fdde53d52f12acc66bde9ae23870bcde Mon Sep 17 00:00:00 2001 From: Derek Ditch Date: Wed, 27 May 2026 09:35:09 -0500 Subject: [PATCH] fix(helm): add LoadBalancer service type support (#3049) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The service template only handled ClusterIP and NodePort via if/else-if branches. When service.type=LoadBalancer was set, no branch matched and the type field was omitted from the rendered Service, causing Kubernetes to silently default to ClusterIP. Add the missing LoadBalancer branch with support for: - loadBalancerIP: request a specific IP (e.g. Cilium LB-IPAM, MetalLB) - loadBalancerClass: select a specific LB implementation - loadBalancerSourceRanges: restrict client source IPs This is particularly useful for bare-metal / on-prem clusters using software load balancers (Cilium LB-IPAM, MetalLB, kube-vip) where a stable routable IP is preferable to an Ingress for S3 clients. Co-authored-by: Claude Sonnet 4.6 Co-authored-by: houseme Co-authored-by: 安正超 Co-authored-by: cxymds Co-authored-by: majinghe <42570491+majinghe@users.noreply.github.com> --- helm/rustfs/Chart.yaml | 2 +- helm/rustfs/templates/service.yaml | 12 ++++++++++++ helm/rustfs/values.yaml | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/helm/rustfs/Chart.yaml b/helm/rustfs/Chart.yaml index 1027301bf..4d812c2f4 100644 --- a/helm/rustfs/Chart.yaml +++ b/helm/rustfs/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rustfs description: RustFS helm chart to deploy RustFS on kubernetes cluster. type: application -version: "0.4.0" +version: "0.4.1" appVersion: "1.0.0-beta.4" home: https://rustfs.com icon: https://media.sys.truenas.net/apps/rustfs/icons/icon.svg diff --git a/helm/rustfs/templates/service.yaml b/helm/rustfs/templates/service.yaml index 56d6b146b..c600e3ccc 100644 --- a/helm/rustfs/templates/service.yaml +++ b/helm/rustfs/templates/service.yaml @@ -51,6 +51,18 @@ spec: sessionAffinityConfig: clientIP: timeoutSeconds: 10800 + {{- else if eq $serviceType "LoadBalancer" }} + type: LoadBalancer + {{- with .Values.service.loadBalancerIP }} + loadBalancerIP: {{ . }} + {{- end }} + {{- with .Values.service.loadBalancerClass }} + loadBalancerClass: {{ . }} + {{- end }} + {{- with .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} ports: - name: endpoint diff --git a/helm/rustfs/values.yaml b/helm/rustfs/values.yaml index c3784c2c4..740e71ca4 100644 --- a/helm/rustfs/values.yaml +++ b/helm/rustfs/values.yaml @@ -176,6 +176,10 @@ service: traefik.ingress.kubernetes.io/service.sticky.cookie.samesite: none traefik.ingress.kubernetes.io/service.sticky.cookie.secure: "true" type: ClusterIP + # LoadBalancer-specific fields (only used when type=LoadBalancer) + loadBalancerIP: "" # Request a specific IP from the load balancer (e.g. for Cilium LB-IPAM or MetalLB) + loadBalancerClass: "" # Specify a load balancer implementation (e.g. "io.cilium/bgp", "metallb") + loadBalancerSourceRanges: [] # Restrict client IPs (e.g. ["10.0.0.0/8"]) endpoint: port: 9000 nodePort: 32000