blob: fb5a081e0edbaa3451e9f43d8bbbd53926420a0d [file] [log] [blame]
Giorgi Lekveishvili0ba5e402024-03-20 15:56:30 +04001{{- if .Values.ingress.enabled -}}
2{{- $serviceName := printf "%s-%s" (include "pihole.fullname" .) "web" -}}
3{{- $ingressPath := .Values.ingress.path -}}
4apiVersion: networking.k8s.io/v1
5kind: Ingress
6metadata:
7 name: {{ template "pihole.fullname" . }}
8 labels:
9 app: {{ template "pihole.name" . }}
10 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
11 release: {{ .Release.Name }}
12 heritage: {{ .Release.Service }}
13 {{- with .Values.ingress.annotations }}
14 annotations:
15 {{- toYaml . | nindent 4 }}
16 {{- end }}
17spec:
18{{- if .Values.ingress.ingressClassName }}
19 ingressClassName: {{ .Values.ingress.ingressClassName }}
20{{- end }}
21{{- if .Values.ingress.tls }}
22 tls:
23{{ toYaml .Values.ingress.tls | indent 4 }}
24{{- end }}
25 rules:
26 {{- range .Values.ingress.hosts }}
27 - host: {{ . | quote }}
28 http:
29 paths:
30 - path: {{ $ingressPath }}
31 pathType: ImplementationSpecific
32 backend:
33 service:
34 name: {{ $serviceName }}
35 port:
36 name: http
37 {{- end }}
38{{- end }}