2020-08-23 12:56:55 -05:00
|
|
|
{{- if .Values.ingress.enabled -}}
|
|
|
|
{{- $fullName := include "gitea.fullname" . -}}
|
|
|
|
{{- $httpPort := .Values.service.http.port -}}
|
2020-12-08 06:57:52 -06:00
|
|
|
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
|
2020-11-24 16:55:49 -06:00
|
|
|
apiVersion: networking.k8s.io/v1
|
2020-12-08 06:57:52 -06:00
|
|
|
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}}
|
2020-08-23 12:56:55 -05:00
|
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
|
|
{{- else -}}
|
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
{{- end }}
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: {{ $fullName }}
|
|
|
|
labels:
|
|
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
|
|
{{- with .Values.ingress.annotations }}
|
|
|
|
annotations:
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
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 }}
|
|
|
|
- {{ . | quote }}
|
|
|
|
{{- end }}
|
|
|
|
secretName: {{ .secretName }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
rules:
|
2021-06-24 13:28:45 -05:00
|
|
|
{{- range .Values.ingress.hosts }}
|
|
|
|
- host: {{ .host | quote }}
|
2020-08-23 12:56:55 -05:00
|
|
|
http:
|
|
|
|
paths:
|
2021-06-24 13:28:45 -05:00
|
|
|
{{- range .paths }}
|
|
|
|
- path: {{ .path }}
|
|
|
|
{{- if and .pathType ($.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
|
|
|
|
pathType: {{ .pathType }}
|
2020-12-15 07:34:46 -06:00
|
|
|
{{- end }}
|
2020-08-23 12:56:55 -05:00
|
|
|
backend:
|
2020-12-08 06:57:52 -06:00
|
|
|
{{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
|
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 }}
|