This repository has been archived by the owner on Aug 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
/
attu-ingress.yaml
96 lines (91 loc) · 2.3 KB
/
attu-ingress.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{{- if and .Values.attu.enabled .Values.attu.ingress.enabled }}
{{- $attuServiceName := include "milvus.attu.fullname" . -}}
{{- $attuServicePort := .Values.attu.service.port -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "milvus.attu.fullname" . }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.ingress.labels }}
{{ toYaml .Values.attu.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.attu.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.attu.ingress.tls }}
tls:
{{- range .Values.attu.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
defaultBackend:
service:
name: {{ $attuServiceName }}
port:
number: {{ $attuServicePort }}
{{- end }}
{{- if .Values.attu.ingress.hosts }}
rules:
{{- range $host := .Values.attu.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $attuServiceName }}
port:
number: {{ $attuServicePort }}
{{- end }}
{{- end }}
{{- else }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "milvus.attu.fullname" . }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.ingress.labels }}
{{ toYaml .Values.attu.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.attu.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.attu.ingress.tls }}
tls:
{{- range .Values.attu.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
backend:
serviceName: {{ $attuServiceName }}
servicePort: {{ $attuServicePort }}
{{- end }}
{{- if .Values.attu.ingress.hosts }}
rules:
{{- range $host := .Values.attu.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: {{ $attuServiceName }}
servicePort: {{ $attuServicePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}