mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-02 11:29:17 +00:00
feat: add contour as ingress controller with http proxy (#1729)
Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
{{- if eq .Values.ingress.className "contour" }}
|
||||
apiVersion: projectcontour.io/v1
|
||||
kind: HTTPProxy
|
||||
metadata:
|
||||
name: {{ include "rustfs.fullname" . }}-proxy
|
||||
labels:
|
||||
{{- include "rustfs.labels" . | nindent 4 }}
|
||||
{{- with .Values.commonLabels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
virtualhost:
|
||||
fqdn: {{ .host | quote }}
|
||||
{{- if $.Values.ingress.tls.enabled }}
|
||||
tls:
|
||||
secretName: {{ include "rustfs.fullname" $ }}-tls
|
||||
{{- end }}
|
||||
routes:
|
||||
- conditions:
|
||||
{{- range .paths }}
|
||||
- prefix: {{ .path }}
|
||||
{{- end }}
|
||||
services:
|
||||
- name: {{ include "rustfs.fullname" $ }}-svc
|
||||
port: {{ $.Values.service.console.port }}
|
||||
loadBalancerPolicy:
|
||||
strategy: Cookie
|
||||
timeoutPolicy:
|
||||
response: infinity
|
||||
idle: 5m
|
||||
{{- if $.Values.ingress.tls.enabled }}
|
||||
permitInsecure: true
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,8 +1,12 @@
|
||||
{{- if and .Values.gatewayApi.enabled (eq .Values.gatewayApi.gatewayClass "traefik") }}
|
||||
{{- if .Values.gatewayApi.enabled }}
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: {{ include "rustfs.fullname" . }}-route
|
||||
annotations:
|
||||
{{- if eq .Values.gatewayApi.gatewayClass "contour" }}
|
||||
projectcontour.io/upstream-hash-policy: "cookie"
|
||||
{{- end }}
|
||||
spec:
|
||||
parentRefs:
|
||||
{{- if .Values.gatewayApi.existingGateway.name }}
|
||||
@@ -12,7 +16,7 @@ spec:
|
||||
{{- end }}
|
||||
sectionName: https
|
||||
{{- else }}
|
||||
- name: {{ include "rustfs.fullname" . }}-gateway
|
||||
- name: {{ include "rustfs.fullname" $ }}-gateway
|
||||
sectionName: https
|
||||
{{- end }}
|
||||
hostnames:
|
||||
@@ -23,10 +27,15 @@ spec:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
backendRefs:
|
||||
{{- if eq .Values.gatewayApi.gatewayClass "traefik" }}
|
||||
- name: {{ include "rustfs.fullname" . }}-sticky-svc
|
||||
port: {{ .Values.service.console.port }}
|
||||
kind: TraefikService
|
||||
group: traefik.io
|
||||
{{- else if eq .Values.gatewayApi.gatewayClass "contour" }}
|
||||
- name: {{ include "rustfs.fullname" $ }}-svc
|
||||
port: {{ .Values.service.console.port }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
@@ -42,7 +51,7 @@ spec:
|
||||
{{- end }}
|
||||
sectionName: http
|
||||
{{- else }}
|
||||
- name: {{ include "rustfs.fullname" . }}-gateway
|
||||
- name: {{ include "rustfs.fullname" $ }}-gateway
|
||||
sectionName: http
|
||||
{{- end }}
|
||||
rules:
|
||||
@@ -51,4 +60,4 @@ spec:
|
||||
requestRedirect:
|
||||
scheme: https
|
||||
statusCode: 301
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user