forked from openfaas/faas-netes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathingress.yaml
47 lines (47 loc) · 1.61 KB
/
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
{{- if .Values.ingress.enabled -}}
{{- $apiIsStable := eq (include "openfaas.ingress.isStable" .) "true" -}}
{{- $pathType := .Values.ingress.pathType | default "ImplementationSpecific" -}}
{{- $ingressSupportsPathType := eq (include "openfaas.ingress.supportsPathType" .) "true" -}}
apiVersion: {{ include "openfaas.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ template "openfaas.name" . }}-ingress
namespace: {{ .Release.Namespace | quote }}
labels:
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host.host }}
http:
paths:
- path: {{ $host.path }}
{{- if and $pathType $ingressSupportsPathType }}
pathType: {{ $pathType }}
{{- end }}
backend:
{{- if $apiIsStable }}
service:
name: {{ $host.serviceName }}
port:
number: {{ $host.servicePort }}
{{- else }}
serviceName: {{ $host.serviceName }}
servicePort: {{ $host.servicePort }}
{{- end }}
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}