fix: traefik gateway api support with sticky session (#1660)

Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
majinghe
2026-01-30 12:34:31 +08:00
committed by GitHub
parent 2ee81496b0
commit 1c085590ca
5 changed files with 27 additions and 7 deletions
@@ -18,6 +18,6 @@ spec:
tls:
mode: Terminate
certificateRefs:
- name: {{ .Values.gatewayApi.secretName }}
- name: {{ .Values.ingress.tls.secretName }}
kind: Secret
{{- end }}
@@ -1,4 +1,4 @@
{{- if .Values.gatewayApi.enabled -}}
{{- if and .Values.gatewayApi.enabled (eq .Values.gatewayApi.gatewayClass "traefik") }}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
@@ -21,6 +21,8 @@ spec:
type: PathPrefix
value: /
backendRefs:
- name: rustfs-svc
port: 9001
{{- end }}
- name: {{ include "rustfs.fullname" . }}-sticky-svc
port: {{ .Values.service.console.port }}
kind: TraefikService
group: traefik.io
{{- end }}
@@ -0,0 +1,19 @@
{{- if eq .Values.gatewayApi.gatewayClass "traefik" }}
apiVersion: traefik.io/v1alpha1
kind: TraefikService
metadata:
name: {{ include "rustfs.fullname" . }}-sticky-svc
spec:
weighted:
services:
- name: {{ include "rustfs.fullname" . }}-svc
namespace: {{ .Release.Namespace }}
port: {{ .Values.service.console.port }}
weight: 1
sticky:
cookie:
name: rustfs
httpOnly: true
secure: true
sameSite: none
{{- end }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- if and (or .Values.gatewayApi.enabled .Values.ingress.tls.enabled) (not (or .Values.ingress.tls.certManager.enabled .Values.gatewayApi.existingGateway.name)) }}
{{- if .Values.ingress.tls.enabled -}}
apiVersion: v1
kind: Secret
metadata:
-1
View File
@@ -141,7 +141,6 @@ gatewayApi:
enabled: false
gatewayClass: traefik
hostname: example.rustfs.com
secretName: secret-tls
existingGateway:
name: ""
namespace: ""