Repository navigation
Expand file tree
/
Copy pathingress.yaml
More file actions
74 lines (74 loc) · 2.37 KB
/
Copy pathingress.yaml
File metadata and controls
74 lines (74 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{{- if and .Values.dashboard.enabled .Values.dashboard.ingress.enabled -}}
{{- if not .Values.dashboard.ingress.host }}
{{- fail "dashboard.ingress.enabled is true but dashboard.ingress.host is empty — set a hostname for the dashboard" }}
{{- end }}
{{- if eq .Values.dashboard.ingress.kind "IngressRoute" }}
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: {{ .Chart.Name }}-dashboard
labels:
{{- include "s3proxy.labels" . | nindent 4 }}
{{- with .Values.dashboard.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.dashboard.ingress.entryPoints }}
entryPoints:
{{- toYaml . | nindent 4 }}
{{- end }}
routes:
- match: Host(`{{ .Values.dashboard.ingress.host }}`) && PathPrefix(`{{ .Values.dashboard.path }}`)
kind: Rule
{{- with .Values.dashboard.ingress.middlewares }}
middlewares:
{{- toYaml . | nindent 8 }}
{{- end }}
services:
- name: {{ .Chart.Name }}-dashboard
port: {{ .Values.dashboard.frontend.service.port }}
{{- with .Values.dashboard.ingress.tls }}
tls:
secretName: {{ (first .).secretName }}
{{- end }}
{{- else }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Chart.Name }}-dashboard
labels:
{{- include "s3proxy.labels" . | nindent 4 }}
{{- with .Values.dashboard.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.dashboard.ingress.className }}
{{- with .Values.dashboard.ingress.tls }}
tls:
{{- range . }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.dashboard.ingress.host | quote }}
http:
paths:
# The whole dashboard.path goes to the dashboard Deployment. Its nginx serves
# the static UI and reverse-proxies dashboard.path/api (JSON + SSE) and the
# form-auth endpoints to the proxy service, so the dashboard is single
# origin behind one backend.
- path: {{ .Values.dashboard.path }}
pathType: Prefix
backend:
service:
name: {{ .Chart.Name }}-dashboard
port:
number: {{ .Values.dashboard.frontend.service.port }}
{{- end }}
{{- end }}