blob: eb1965565ed1d9e7ce20b1684e9f1997d86ff20c [file] [log] [blame]
Giorgi Lekveishviliee15ee22024-03-28 12:35:10 +04001{{- if .Values.ingress.enabled }}
2apiVersion: networking.k8s.io/v1
3kind: Ingress
4metadata:
5 name: {{ .Release.Name }}-gerrit-ingress
6 labels:
7 app.kubernetes.io/component: gerrit
8 app.kubernetes.io/instance: {{ .Release.Name }}
9 chart: {{ template "gerrit.chart" . }}
10 heritage: {{ .Release.Service }}
11 release: {{ .Release.Name }}
12 {{- if .Values.ingress.additionalLabels }}
13{{ toYaml .Values.ingress.additionalLabels | indent 4 }}
14 {{- end }}
15 annotations:
16 nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.ingress.maxBodySize | default "50m" }}
17 {{- if .Values.ingress.additionalAnnotations }}
18{{ toYaml .Values.ingress.additionalAnnotations | indent 4 }}
19 {{- end }}
20spec:
21 {{ if .Values.ingress.tls.enabled -}}
22 tls:
23 - hosts:
24 - {{ .Values.ingress.host }}
25 {{ if .Values.ingress.tls.secret.create -}}
26 secretName: {{ .Release.Name }}-gerrit-tls-secret
27 {{- else }}
28 secretName: {{ .Values.ingress.tls.secret.name }}
29 {{- end }}
30 {{- end }}
31 rules:
32 - host: {{required "A host URL is required for the Gerrit Ingress. Please set 'ingress.host'" .Values.ingress.host }}
33 http:
34 paths:
35 - pathType: Prefix
36 path: /
37 backend:
38 service:
39 name: {{ .Release.Name }}-gerrit-service
40 port:
41 number: {{ .Values.gerrit.service.http.port }}
42{{- end }}
43---
44{{ if and .Values.ingress.tls.enabled .Values.ingress.tls.secret.create -}}
45apiVersion: v1
46kind: Secret
47metadata:
48 name: {{ .Release.Name }}-gerrit-tls-secret
49 labels:
50 app.kubernetes.io/component: gerrit
51 app.kubernetes.io/instance: {{ .Release.Name }}
52 chart: {{ template "gerrit.chart" . }}
53 heritage: {{ .Release.Service }}
54 release: {{ .Release.Name }}
55 {{- if .Values.ingress.additionalLabels }}
56{{ toYaml .Values.ingress.additionalLabels | indent 4 }}
57 {{- end }}
58type: kubernetes.io/tls
59data:
60 {{ with .Values.ingress.tls -}}
61 tls.crt: {{ .cert | b64enc }}
62 tls.key: {{ .key | b64enc }}
63 {{- end }}
64{{- end }}