-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{{- if and .Values.global.ingress.enabled (or (eq .Values.global.ingress.className "haproxy") (eq .Values.global.ingress.classType "haproxy")) }} | ||
{{- $fullName := include "keep.fullname" . }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ $fullName }}-ingress | ||
labels: | ||
{{- include "keep.labels" . | nindent 4 }} | ||
annotations: | ||
kubernetes.io/ingress.class: "haproxy" | ||
# HAProxy timeout configurations | ||
haproxy-ingress.github.io/timeout-client: "3600s" | ||
haproxy-ingress.github.io/timeout-server: "3600s" | ||
haproxy-ingress.github.io/timeout-connect: "3600s" | ||
haproxy-ingress.github.io/timeout-tunnel: "3600s" | ||
|
||
# WebSocket support | ||
haproxy-ingress.github.io/config-backend: | | ||
timeout tunnel 3600s | ||
option http-keep-alive | ||
http-reuse safe | ||
haproxy-ingress.github.io/ssl-redirect: "false" | ||
|
||
# Backend configurations for path rewrites | ||
haproxy-ingress.github.io/config-backend: | | ||
acl path_v2 path_beg /v2/ | ||
acl path_ws path_beg /websocket/ | ||
http-request set-path %[path,regsub(^/v2/,/)] if path_v2 | ||
http-request set-path %[path,regsub(^/websocket/,/)] if path_ws | ||
spec: | ||
ingressClassName: haproxy | ||
{{- if .Values.global.ingress.tls }} | ||
tls: | ||
{{- range .Values.global.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- if .Values.global.ingress.hosts }} | ||
{{- range .Values.global.ingress.hosts }} | ||
- host: {{ .host | quote }} | ||
http: | ||
paths: | ||
{{- if $.Values.websocket.enabled }} | ||
- path: "/websocket" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-websocket | ||
port: | ||
number: {{ $.Values.websocket.service.port }} | ||
{{- end }} | ||
{{- if $.Values.backend.enabled }} | ||
- path: "/v2" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-backend | ||
port: | ||
number: {{ $.Values.backend.service.port }} | ||
{{- end }} | ||
- path: "/" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-frontend | ||
port: | ||
number: {{ $.Values.frontend.service.port }} | ||
{{- end }} | ||
{{- else }} | ||
- http: | ||
paths: | ||
{{- if $.Values.websocket.enabled }} | ||
- path: "/websocket" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-websocket | ||
port: | ||
number: {{ $.Values.websocket.service.port }} | ||
{{- end }} | ||
{{- if $.Values.backend.enabled }} | ||
- path: "/v2" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-backend | ||
port: | ||
number: {{ $.Values.backend.service.port }} | ||
{{- end }} | ||
- path: "/" | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ $fullName }}-frontend | ||
port: | ||
number: {{ $.Values.frontend.service.port }} | ||
{{- end }} | ||
{{- end }} |
2 changes: 1 addition & 1 deletion
2
charts/keep/templates/ingress.yaml → charts/keep/templates/ingress-nginx.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters