-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathingress.yaml
More file actions
44 lines (44 loc) · 1.92 KB
/
ingress.yaml
File metadata and controls
44 lines (44 loc) · 1.92 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
{{- if .Values.mosquitto.ingress.enabled -}}
apiVersion: {{ include "mosquitto.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "mosquitto.fullname" . }}
labels: {{- include "mosquitto.labels.standard" . | nindent 4 }}
{{- with .Values.mosquitto.common.labels }}
{{- toYaml . | trim | nindent 4 }}
{{- end }}
{{- with .Values.mosquitto.ingress.labels }}
{{- toYaml . | trim | nindent 4 }}
{{- end }}
{{- if or .Values.mosquitto.common.annotations .Values.mosquitto.ingress.annotations }}
annotations:
{{- with .Values.mosquitto.common.annotations }}
{{- toYaml . | trim | nindent 4 }}
{{- end }}
{{- with .Values.mosquitto.ingress.annotations }}
{{- toYaml . | trim | nindent 4 }}
{{- end }}
{{- end }}
spec:
rules:
{{- range $host := (required ".Values.mosquitto.ingress.hosts is required" .Values.mosquitto.ingress.hosts) }}
- host: {{ required "$host.name is required!" $host.name }}
http:
paths:
{{- range $path := (required "$host.paths is required" $host.paths) }}
- path: {{ required "$path.name is required" $path.name }}
{{- if eq "true" (include "mosquitto.ingress.supportsPathType" $) }}
pathType: {{ $path.type | default "ImplementationSpecific" }}
{{- end }}
backend: {{- include "mosquitto.ingress.backend" (dict "serviceName" (include "mosquitto.fullname" $) "servicePort" (required "$path.port is required!" $path.port) "context" $) | nindent 14 }}
{{- end }}
{{- end }}
{{- if .Values.mosquitto.ingress.tls.enabled }}
tls:
- secretName: {{ printf "%s-certs" (include "mosquitto.fullname" .) }}
hosts:
{{- range $host := (required ".Values.mosquitto.ingress.hosts is required!" .Values.mosquitto.ingress.hosts) }}
- {{ printf "%s" (required "$host.name is required" $host.name) }}
{{- end }}
{{- end }}
{{- end -}}