blob: 02d9dbf1c3d32d40da333f139424e36d660956ad [file] [log] [blame]
gio4a9d83d2024-04-14 13:14:40 +04001{{- if .Values.ingress.enabled -}}
2{{- $fullName := include "zot.fullname" . -}}
3{{- $httpPort := .Values.service.port -}}
4{{- $pathtype := .Values.ingress.pathtype -}}
5{{- $ingressPath := .Values.ingress.path -}}
6apiVersion: networking.k8s.io/v1
7kind: Ingress
8metadata:
9 name: {{ $fullName }}
10 labels:
11 app: {{ .Chart.Name }}
12 release: {{ .Release.Name }}
13{{- with .Values.ingress.annotations }}
14 annotations:
15{{ toYaml . | indent 4 }}
16{{- end }}
17spec:
18 {{- if .Values.ingress.className }}
19 ingressClassName: {{ .Values.ingress.className | quote }}
20 {{- end }}
21{{- if .Values.ingress.tls }}
22 tls:
23 {{- if .ingressPath }}
24 {{- range .Values.ingress.tls }}
25 - hosts:
26 {{- range .hosts }}
27 - {{ . }}
28 {{- end }}
29 secretName: {{ .secretName }}
30 {{- end }}
31{{- else }}
32{{ toYaml .Values.ingress.tls | indent 4 }}
33 {{- end }}
34{{- end}}
35 rules:
36 {{- range .Values.ingress.hosts }}
37 {{- if $ingressPath }}
38 - host: {{ . }}
39 http:
40 paths:
41 - path: {{ $ingressPath }}
42 pathType: {{ $pathtype }}
43 backend:
44 service:
45 name: {{ $fullName }}
46 port:
47 number: {{ $httpPort }}
48 {{- else }}
49 - host: {{ .host }}
50 http:
51 paths:
52 {{- range .paths }}
53 - path: {{ .path }}
54 pathType: {{ $pathtype }}
55 backend:
56 service:
57 name: {{ $fullName }}
58 port:
59 number: {{ .servicePort | default $httpPort }}
60 {{- end }}
61 {{- end }}
62 {{- end }}
63 {{- end }}