{{- if .Values.ingress.enabled -}} {{- $fullName := include "gitea.fullname" . -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "gitea.labels" . | nindent 4 }} annotations: {{- range $key, $value := .Values.ingress.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} spec: {{- if .Values.ingress.className }} ingressClassName: {{ tpl .Values.ingress.className . }} {{- end }} {{- 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: {{- range .paths }} - path: {{ .path }} {{- if .pathType }} pathType: {{ .pathType }} {{- end }} backend: service: name: {{ $fullName }}-http port: name: http {{- end }} {{- end }} {{- end }}