The value only ever populated the `spec.ingressClassName` field of the Ingress resource, so the shortened name was a needless deviation from the Kubernetes API. `ingress.className` carried a `DEPRECATED` marker since #679, but that marker was a leftover: the rename to the canonical name was proposed there, rejected during review and the follow-up commits only removed the half-merged template fallback. The marker stayed behind for a year while the value remained the one and only way to set the Ingress class, which made the documentation actively misleading. The deprecation guard uses `hasKey` instead of a truthiness check on purpose. The previous chart default was an empty string, so vendored values files tend to carry `ingress.className: ""` verbatim. A truthiness check would silently ignore those and leave users wondering why their Ingress class is no longer applied. Co-authored-by: Copilot <copilot@github.com>
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
{{- if eq (include "gitea.ingress.enabled" .) "true" -}}
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
{{- with (include "gitea.ingress.annotations" .) }}
|
|
annotations:
|
|
{{- . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with (include "gitea.ingress.labels" .) }}
|
|
labels:
|
|
{{- . | nindent 4 }}
|
|
{{- end }}
|
|
name: {{ include "gitea.ingress.name" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
spec:
|
|
ingressClassName: {{ tpl .Values.ingress.ingressClassName . }}
|
|
rules:
|
|
{{- range .Values.ingress.hosts }}
|
|
- host: {{ tpl .host $ | quote }}
|
|
http:
|
|
paths:
|
|
{{- if .paths }}
|
|
{{- range .paths }}
|
|
{{- if kindIs "string" . }}
|
|
- path: {{ . }}
|
|
pathType: {{ default "Prefix" $.Values.ingress.pathType }}
|
|
backend:
|
|
service:
|
|
name: {{ include "gitea.service.http.name" $ }}
|
|
port:
|
|
number: {{ $.Values.service.http.port }}
|
|
{{- else }}
|
|
- path: {{ .path | default "/" }}
|
|
pathType: {{ .pathType | default "Prefix" }}
|
|
backend:
|
|
service:
|
|
name: {{ include "gitea.service.http.name" $ }}
|
|
port:
|
|
number: {{ $.Values.service.http.port }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- else }}
|
|
- path: "/"
|
|
pathType: "Prefix"
|
|
backend:
|
|
service:
|
|
name: {{ include "gitea.service.http.name" $ }}
|
|
port:
|
|
number: {{ $.Values.service.http.port }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.ingress.tls }}
|
|
tls:
|
|
{{- range .Values.ingress.tls }}
|
|
- hosts:
|
|
{{- range .hosts }}
|
|
- {{ tpl . $ | quote }}
|
|
{{- end }}
|
|
secretName: {{ .secretName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|