mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-29 08:27:06 +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
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
kind: HTTPRoute
|
kind: HTTPRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "rustfs.fullname" . }}-route
|
name: {{ include "rustfs.fullname" . }}-route
|
||||||
|
annotations:
|
||||||
|
{{- if eq .Values.gatewayApi.gatewayClass "contour" }}
|
||||||
|
projectcontour.io/upstream-hash-policy: "cookie"
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
parentRefs:
|
parentRefs:
|
||||||
{{- if .Values.gatewayApi.existingGateway.name }}
|
{{- if .Values.gatewayApi.existingGateway.name }}
|
||||||
@@ -12,7 +16,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
sectionName: https
|
sectionName: https
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- name: {{ include "rustfs.fullname" . }}-gateway
|
- name: {{ include "rustfs.fullname" $ }}-gateway
|
||||||
sectionName: https
|
sectionName: https
|
||||||
{{- end }}
|
{{- end }}
|
||||||
hostnames:
|
hostnames:
|
||||||
@@ -23,10 +27,15 @@ spec:
|
|||||||
type: PathPrefix
|
type: PathPrefix
|
||||||
value: /
|
value: /
|
||||||
backendRefs:
|
backendRefs:
|
||||||
|
{{- if eq .Values.gatewayApi.gatewayClass "traefik" }}
|
||||||
- name: {{ include "rustfs.fullname" . }}-sticky-svc
|
- name: {{ include "rustfs.fullname" . }}-sticky-svc
|
||||||
port: {{ .Values.service.console.port }}
|
port: {{ .Values.service.console.port }}
|
||||||
kind: TraefikService
|
kind: TraefikService
|
||||||
group: traefik.io
|
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
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
@@ -42,7 +51,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
sectionName: http
|
sectionName: http
|
||||||
{{- else }}
|
{{- else }}
|
||||||
- name: {{ include "rustfs.fullname" . }}-gateway
|
- name: {{ include "rustfs.fullname" $ }}-gateway
|
||||||
sectionName: http
|
sectionName: http
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
|
|||||||
Reference in New Issue
Block a user