22apiVersion : networking.k8s.io/v1
33kind : Ingress
44metadata :
5- name : {{ include "opensampl.fullname" . }}
5+ name : {{ include "opensampl.fullname" . }}-ingress
6+ labels :
7+ {{- include "opensampl.labels" . | nindent 4 }}
8+ {{- with .Values.ingress.annotations }}
69 annotations :
7- {{- toYaml .Values.ingress.annotations | nindent 4 }}
10+ {{- toYaml . | nindent 4 }}
11+ {{- end }}
812spec :
13+ {{- if .Values.ingress.className }}
914 ingressClassName : {{ .Values.ingress.className }}
15+ {{- end }}
16+ {{- if .Values.ingress.tls }}
1017 tls :
11- {{- toYaml .Values.ingress.tls | nindent 4 }}
18+ {{- range .Values.ingress.tls }}
19+ - hosts :
20+ {{- range .hosts }}
21+ - {{ . | quote }}
22+ {{- end }}
23+ secretName : {{ .secretName }}
24+ {{- end }}
25+ {{- end }}
1226 rules :
13- - host : {{ (index .Values.ingress.hosts 0).host }}
27+ {{- range .Values.ingress.hosts }}
28+ - host : {{ .host | quote }}
1429 http :
1530 paths :
16- - path : /api(/|$)(.*)
17- pathType : Prefix
31+ {{- range .paths }}
32+ - path : {{ .path }}
33+ pathType : {{ .pathType }}
1834 backend :
1935 service :
20- name : {{ include "opensampl.fullname" . }}-backend
36+ name : {{ include "opensampl.fullname" $ }}-{{ .service }}
2137 port :
22- number : {{ .Values.backend.service.port }}
23-
24- - path : /grafana(/|$)(.*)
25- pathType : Prefix
26- backend :
27- service :
28- name : {{ include "opensampl.fullname" . }}-grafana
29- port :
30- number : {{ .Values.grafana.port }}
31-
32- - path : /
33- pathType : Prefix
34- backend :
35- service :
36- name : {{ include "opensampl.fullname" . }}-backend
37- port :
38- number : {{ .Values.backend.service.port }}
39- {{- end }}
38+ number : {{ if eq .service "backend" }}{{ $.Values.backend.service.port }}{{ else }}{{ $.Values.grafana.port }}{{ end }}
39+ {{- end }}
40+ {{- end }}
41+ {{- end }}
0 commit comments