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