mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 13:16:28 +00:00
enhancement: add support for http to https redirect for traefik gatew… (#1712)
This commit is contained in:
@@ -5,19 +5,25 @@ metadata:
|
|||||||
name: {{ include "rustfs.fullname" . }}-gateway
|
name: {{ include "rustfs.fullname" . }}-gateway
|
||||||
spec:
|
spec:
|
||||||
gatewayClassName: {{ .Values.gatewayApi.gatewayClass }}
|
gatewayClassName: {{ .Values.gatewayApi.gatewayClass }}
|
||||||
|
{{- with .Values.gatewayApi.listeners }}
|
||||||
listeners:
|
listeners:
|
||||||
|
{{- if .web }}
|
||||||
- name: http
|
- name: http
|
||||||
port: 80
|
port: {{ .web.port }}
|
||||||
protocol: HTTP
|
protocol: HTTP
|
||||||
allowedRoutes:
|
allowedRoutes:
|
||||||
namespaces:
|
namespaces:
|
||||||
from: Same
|
from: Same
|
||||||
|
{{- end }}
|
||||||
|
{{- if .websecure }}
|
||||||
- name: https
|
- name: https
|
||||||
port: 443
|
port: {{ .websecure.port }}
|
||||||
protocol: HTTPS
|
protocol: HTTPS
|
||||||
tls:
|
tls:
|
||||||
mode: Terminate
|
mode: Terminate
|
||||||
certificateRefs:
|
certificateRefs:
|
||||||
- name: {{ .Values.ingress.tls.secretName }}
|
- name: {{ include "rustfs.fullname" $ }}-tls
|
||||||
kind: Secret
|
kind: Secret
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ spec:
|
|||||||
{{- if .Values.gatewayApi.existingGateway.namespace }}
|
{{- if .Values.gatewayApi.existingGateway.namespace }}
|
||||||
namespace: {{ .Values.gatewayApi.existingGateway.namespace }}
|
namespace: {{ .Values.gatewayApi.existingGateway.namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
sectionName: https
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- name: {{ include "rustfs.fullname" . }}-gateway
|
- name: {{ include "rustfs.fullname" . }}-gateway
|
||||||
|
sectionName: https
|
||||||
{{- end }}
|
{{- end }}
|
||||||
hostnames:
|
hostnames:
|
||||||
- {{ .Values.gatewayApi.hostname }}
|
- {{ .Values.gatewayApi.hostname }}
|
||||||
@@ -25,4 +27,28 @@ spec:
|
|||||||
port: {{ .Values.service.console.port }}
|
port: {{ .Values.service.console.port }}
|
||||||
kind: TraefikService
|
kind: TraefikService
|
||||||
group: traefik.io
|
group: traefik.io
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
|
kind: HTTPRoute
|
||||||
|
metadata:
|
||||||
|
name: {{ include "rustfs.fullname" . }}-redirect
|
||||||
|
spec:
|
||||||
|
parentRefs:
|
||||||
|
{{- if .Values.gatewayApi.existingGateway.name }}
|
||||||
|
- name: {{ .Values.gatewayApi.existingGateway.name }}
|
||||||
|
{{- if .Values.gatewayApi.existingGateway.namespace }}
|
||||||
|
namespace: {{ .Values.gatewayApi.existingGateway.namespace }}
|
||||||
|
{{- end }}
|
||||||
|
sectionName: http
|
||||||
|
{{- else }}
|
||||||
|
- name: {{ include "rustfs.fullname" . }}-gateway
|
||||||
|
sectionName: http
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- filters:
|
||||||
|
- type: RequestRedirect
|
||||||
|
requestRedirect:
|
||||||
|
scheme: https
|
||||||
|
statusCode: 301
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -14,6 +14,6 @@ spec:
|
|||||||
cookie:
|
cookie:
|
||||||
name: rustfs
|
name: rustfs
|
||||||
httpOnly: true
|
httpOnly: true
|
||||||
secure: true
|
secure: {{ .Values.ingress.tls.enabled | default false }}
|
||||||
sameSite: none
|
sameSite: {{ if .Values.ingress.tls.enabled }}none{{ else }}lax{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{- $secretName := .Values.ingress.tls.secretName }}
|
|
||||||
{{- $ingressAnnotations := dict }}
|
{{- $ingressAnnotations := dict }}
|
||||||
{{- if eq .Values.ingress.className "nginx" }}
|
{{- if eq .Values.ingress.className "nginx" }}
|
||||||
{{- $ingressAnnotations = .Values.ingress.nginxAnnotations }}
|
{{- $ingressAnnotations = .Values.ingress.nginxAnnotations }}
|
||||||
@@ -29,7 +28,7 @@ spec:
|
|||||||
{{- range .Values.ingress.hosts }}
|
{{- range .Values.ingress.hosts }}
|
||||||
- {{ .host | quote }}
|
- {{ .host | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
secretName: {{ $secretName }}
|
secretName: {{ include "rustfs.fullname" $ }}-tls
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
{{- range .Values.ingress.hosts }}
|
||||||
|
|||||||
@@ -150,6 +150,11 @@ ingress:
|
|||||||
gatewayApi:
|
gatewayApi:
|
||||||
enabled: false
|
enabled: false
|
||||||
gatewayClass: traefik
|
gatewayClass: traefik
|
||||||
|
listeners: # Specify which listeners to create on the Gateway. Only support for traefik gatewayClass at the moment.
|
||||||
|
web:
|
||||||
|
port: 8000
|
||||||
|
websecure:
|
||||||
|
port: 8443
|
||||||
hostname: example.rustfs.com
|
hostname: example.rustfs.com
|
||||||
existingGateway:
|
existingGateway:
|
||||||
name: ""
|
name: ""
|
||||||
|
|||||||
Reference in New Issue
Block a user