2020-08-23 12:56:55 -05:00
|
|
|
{{- if .Values.ingress.enabled -}}
|
|
|
|
{{- $fullName := include "gitea.fullname" . -}}
|
|
|
|
{{- $httpPort := .Values.service.http.port -}}
|
2021-12-20 05:54:37 -06:00
|
|
|
{{- $apiVersion := "extensions/v1beta1" -}}
|
|
|
|
{{- if .Values.ingress.apiVersion -}}
|
|
|
|
{{- $apiVersion = .Values.ingress.apiVersion -}}
|
|
|
|
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
|
|
|
{{- $apiVersion = "networking.k8s.io/v1" }}
|
2020-12-08 06:57:52 -06:00
|
|
|
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}}
|
2021-12-20 05:54:37 -06:00
|
|
|
{{- $apiVersion = "networking.k8s.io/v1beta1" }}
|
2020-08-23 12:56:55 -05:00
|
|
|
{{- end }}
|
2021-12-20 05:54:37 -06:00
|
|
|
apiVersion: {{ $apiVersion }}
|
2020-08-23 12:56:55 -05:00
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: {{ $fullName }}
|
|
|
|
labels:
|
|
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
|
|
annotations:
|
2023-08-31 12:07:45 -05:00
|
|
|
{{- range $key, $value := .Values.ingress.annotations }}
|
|
|
|
{{ $key }}: {{ $value | quote }}
|
|
|
|
{{- end }}
|
2020-08-23 12:56:55 -05:00
|
|
|
spec:
|
2021-09-01 21:53:48 -05:00
|
|
|
{{- if .Values.ingress.className }}
|
|
|
|
ingressClassName: {{ .Values.ingress.className }}
|
|
|
|
{{- end }}
|
2020-08-23 12:56:55 -05:00
|
|
|
{{- if .Values.ingress.tls }}
|
|
|
|
tls:
|
|
|
|
{{- range .Values.ingress.tls }}
|
|
|
|
- hosts:
|
|
|
|
{{- range .hosts }}
|
2023-09-22 10:09:13 -05:00
|
|
|
- {{ tpl . $ | quote }}
|
2020-08-23 12:56:55 -05:00
|
|
|
{{- end }}
|
|
|
|
secretName: {{ .secretName }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
rules:
|
2021-06-24 13:28:45 -05:00
|
|
|
{{- range .Values.ingress.hosts }}
|
2023-09-22 10:09:13 -05:00
|
|
|
- host: {{ tpl .host $ | quote }}
|
2020-08-23 12:56:55 -05:00
|
|
|
http:
|
|
|
|
paths:
|
2021-06-24 13:28:45 -05:00
|
|
|
{{- range .paths }}
|
|
|
|
- path: {{ .path }}
|
2021-12-20 05:54:37 -06:00
|
|
|
{{- if and .pathType (eq $apiVersion "networking.k8s.io/v1") }}
|
2021-06-24 13:28:45 -05:00
|
|
|
pathType: {{ .pathType }}
|
2020-12-15 07:34:46 -06:00
|
|
|
{{- end }}
|
2020-08-23 12:56:55 -05:00
|
|
|
backend:
|
2021-12-20 05:54:37 -06:00
|
|
|
{{- if eq $apiVersion "networking.k8s.io/v1" }}
|
2020-11-25 09:28:53 -06:00
|
|
|
service:
|
|
|
|
name: {{ $fullName }}-http
|
|
|
|
port:
|
|
|
|
number: {{ $httpPort }}
|
2020-11-26 03:01:16 -06:00
|
|
|
{{- else }}
|
2020-08-23 12:56:55 -05:00
|
|
|
serviceName: {{ $fullName }}-http
|
|
|
|
servicePort: {{ $httpPort }}
|
2020-11-25 09:28:53 -06:00
|
|
|
{{- end }}
|
2021-06-24 13:28:45 -05:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2020-08-23 12:56:55 -05:00
|
|
|
{{- end }}
|