mirror of
https://gitea.com/gitea/helm-chart.git
synced 2024-07-07 16:54:12 +02:00
Fixes ingress by using new {service: {name, port}} structure Co-authored-by: Joel Gallant <joel@joelgallant.me> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/65 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: techknowlogick <techknowlogick@gitea.io> Co-Authored-By: joelgallant <joelgallant@noreply.gitea.io> Co-Committed-By: joelgallant <joelgallant@noreply.gitea.io>
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
{{- if .Values.ingress.enabled -}}
|
|
{{- $fullName := include "gitea.fullname" . -}}
|
|
{{- $httpPort := .Values.service.http.port -}}
|
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
apiVersion: networking.k8s.io/v1
|
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
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:
|
|
{{- if .Values.ingress.tls }}
|
|
tls:
|
|
{{- range .Values.ingress.tls }}
|
|
- hosts:
|
|
{{- range .hosts }}
|
|
- {{ . | quote }}
|
|
{{- end }}
|
|
secretName: {{ .secretName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
rules:
|
|
{{- range .Values.ingress.hosts }}
|
|
- host: {{ . | quote }}
|
|
http:
|
|
paths:
|
|
- path: /
|
|
backend:
|
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
|
service:
|
|
name: {{ $fullName }}-http
|
|
port:
|
|
number: {{ $httpPort }}
|
|
{{- else -}}
|
|
serviceName: {{ $fullName }}-http
|
|
servicePort: {{ $httpPort }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|