{{- 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.className . }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ tpl . $ | quote }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} 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 }} {{- end }}