{{- if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ include "trek.fullname" . }} labels: app: {{ include "trek.name" . }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if .Values.ingress.tls }} tls: {{- toYaml .Values.ingress.tls | nindent 4 }} {{- end }} rules: {{- range .Values.ingress.hosts }} - host: {{ .host }} http: paths: {{- range .paths }} - path: {{ . }} pathType: Prefix backend: service: name: {{ include "trek.fullname" $ }} port: number: {{ $.Values.service.port }} {{- end }} {{- end }} {{- end }}