| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 1 | {{- if .Values.ingress.enabled -}} |
| 2 | {{- $serviceName := printf "%s-%s" (include "pihole.fullname" .) "web" -}} |
| 3 | {{- $ingressPath := .Values.ingress.path -}} |
| 4 | apiVersion: networking.k8s.io/v1 |
| 5 | kind: Ingress |
| 6 | metadata: |
| 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 }} |
| 17 | spec: |
| 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 }} |